diff --git a/karma.conf.js b/karma.conf.js index b6b7b20f9..26dc5920d 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -32,6 +32,7 @@ module.exports = function (config) { rules: [ { test: /\.js$/, + exclude: /node_modules/, use: { loader: 'babel-loader', options: { @@ -41,9 +42,6 @@ module.exports = function (config) { 'browsers': ['last 3 versions'] } }] - ], - plugins: [ - 'transform-remove-strict-mode' ] } } diff --git a/package.json b/package.json index 7207c7e1e..62dfcf51e 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,6 @@ "async": "^2.5.0", "babel-core": "^6.26.0", "babel-loader": "^7.1.2", - "babel-plugin-transform-remove-strict-mode": "^0.0.2", "babel-preset-env": "^1.6.0", "babel-preset-es2015": "^6.24.1", "clone": "^2.1.1", diff --git a/src/utils.spec.js b/src/utils.spec.js index a978b9b38..2b31c9364 100644 --- a/src/utils.spec.js +++ b/src/utils.spec.js @@ -87,16 +87,15 @@ describe('when cloning CSS ', function () { } function addMermaidSVGwithStyleToDocument () { - var styleSheetCount = document.styleSheets.length var svg = document.createElement('svg') svg.setAttribute('id', 'mermaid-03') var s = document.createElement('style') s.setAttribute('type', 'text/css') s.setAttribute('title', 'mermaid-svg-internal-css') s.innerHTML = '#mermaid-05 .node2 { stroke:#eee; }\n.node-square { stroke:#bfe; }\n' + s.title = 'mermaid-svg-internal-css' svg.appendChild(s) document.body.appendChild(svg) - document.styleSheets[styleSheetCount].title = 'mermaid-svg-internal-css' } it('should handle errors thrown when accessing CSS rules', function () { @@ -104,7 +103,7 @@ describe('when cloning CSS ', function () { svg.setAttribute('id', 'mermaid-01') // Firefox throws a SecurityError when trying to access cssRules - document.styleSheets[document.styleSheets.length++] = { + document.styleSheets[document.styleSheets.length] = { get cssRules () { throw new Error('SecurityError') } } diff --git a/todo.md b/todo.md index f3b5dde3c..1d52854bf 100644 --- a/todo.md +++ b/todo.md @@ -3,9 +3,6 @@ - Problem is it's for d3 v4 only - Make node console output colors like Chrome console - What's the correct way to change logLevel as an end user? -- d3 v3 doesn't support 'use strict' - - babel-plugin-transform-remove-strict-mode - - need to remove it after upgrading to d3 v4 - Fix CodeClimate - What is live-server ? - Get familar with jison diff --git a/webpack.config.base.js b/webpack.config.base.js index f48548092..ede2ce7d3 100644 --- a/webpack.config.base.js +++ b/webpack.config.base.js @@ -36,9 +36,6 @@ export const webConfig = () => { 'browsers': ['last 3 versions'] } }] - ], - plugins: [ - 'transform-remove-strict-mode' ] } } diff --git a/yarn.lock b/yarn.lock index 3dcb4069a..6696b9f28 100644 --- a/yarn.lock +++ b/yarn.lock @@ -708,10 +708,6 @@ babel-plugin-transform-regenerator@^6.24.1: dependencies: regenerator-transform "^0.10.0" -babel-plugin-transform-remove-strict-mode@^0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-remove-strict-mode/-/babel-plugin-transform-remove-strict-mode-0.0.2.tgz#913685aab95439f3a0ed88e588fbd5e997890579" - babel-plugin-transform-strict-mode@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758"