diff --git a/.eslintrc.js b/.eslintrc.js index 2fc1bfcb9..b4e6c043f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -2,13 +2,13 @@ module.exports = { root: true, - parser: 'typescript-eslint-parser', + parser: '@typescript-eslint/parser', parserOptions: { ecmaVersion: 2017, sourceType: 'module', }, - plugins: ['prettier', 'typescript'], - extends: ['eslint:recommended', 'prettier'], + plugins: ['prettier', '@typescript-eslint'], + extends: ['eslint:recommended', 'plugin:@typescript-eslint/eslint-recommended', 'prettier'], env: { browser: true, }, @@ -20,6 +20,8 @@ module.exports = { { files: ['**/*.ts'], rules: { + 'prefer-const': 'off', + // the TypeScript compiler already takes care of this and // leaving it enabled results in false positives for interface imports 'no-dupe-class-members': 'off', diff --git a/lib/__tests__/has-style.ts b/lib/__tests__/has-style.ts index 52c8a7167..8e2c717df 100644 --- a/lib/__tests__/has-style.ts +++ b/lib/__tests__/has-style.ts @@ -28,7 +28,7 @@ describe('assert.dom(...).hasStyle()', () => { }); test('succeeds for checking styles applied by CSS stylesheets', () => { - var styleNode = document.createElement('style'); + let styleNode = document.createElement('style'); styleNode.innerHTML = '.foo { color: blue }'; document.body.appendChild(styleNode); assert.dom('.foo').hasStyle({ diff --git a/package.json b/package.json index e3d01edfd..9ca750e92 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,8 @@ "@ember/optional-features": "^0.7.0", "@types/jest": "^24.0.15", "@types/qunit": "^2.9.0", + "@typescript-eslint/parser": "^1.11.0", + "@typescript-eslint/eslint-plugin": "^1.11.0", "babel-plugin-transform-es2015-modules-commonjs": "^6.26.0", "babel-preset-env": "^1.6.0", "documentation": "^11.0.1", @@ -54,7 +56,6 @@ "eslint": "^5.16.0", "eslint-config-prettier": "^6.0.0", "eslint-plugin-prettier": "^3.1.0", - "eslint-plugin-typescript": "^0.14.0", "jest": "^24.8.0", "lerna-changelog": "^0.8.0", "loader.js": "^4.2.3", @@ -62,8 +63,7 @@ "rollup": "^1.16.2", "rollup-plugin-typescript2": "^0.21.2", "ts-jest": "^24.0.2", - "typescript": "^3.5.2", - "typescript-eslint-parser": "^22.0.0" + "typescript": "^3.5.2" }, "engines": { "node": "8.* || >= 10.*" diff --git a/yarn.lock b/yarn.lock index 0ab5ba89d..94faaf76f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1236,6 +1236,11 @@ dependencies: "@babel/types" "^7.3.0" +"@types/eslint-visitor-keys@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" + integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag== + "@types/estree@0.0.39": version "0.0.39" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" @@ -1318,6 +1323,43 @@ resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-12.0.9.tgz#693e76a52f61a2f1e7fb48c0eef167b95ea4ffd0" integrity sha512-sCZy4SxP9rN2w30Hlmg5dtdRwgYQfYRiLo9usw8X9cxlf+H4FqM1xX7+sNH7NNKVdbXMJWqva7iyy+fxh/V7fA== +"@typescript-eslint/eslint-plugin@^1.11.0": + version "1.11.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.11.0.tgz#870f752c520db04db6d3668af7479026a6f2fb9a" + integrity sha512-mXv9ccCou89C8/4avKHuPB2WkSZyY/XcTQUXd5LFZAcLw1I3mWYVjUu6eS9Ja0QkP/ClolbcW9tb3Ov/pMdcqw== + dependencies: + "@typescript-eslint/experimental-utils" "1.11.0" + eslint-utils "^1.3.1" + functional-red-black-tree "^1.0.1" + regexpp "^2.0.1" + tsutils "^3.7.0" + +"@typescript-eslint/experimental-utils@1.11.0": + version "1.11.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-1.11.0.tgz#594abe47091cbeabac1d6f9cfed06d0ad99eb7e3" + integrity sha512-7LbfaqF6B8oa8cp/315zxKk8FFzosRzzhF8Kn/ZRsRsnpm7Qcu25cR/9RnAQo5utZ2KIWVgaALr+ZmcbG47ruw== + dependencies: + "@typescript-eslint/typescript-estree" "1.11.0" + eslint-scope "^4.0.0" + +"@typescript-eslint/parser@^1.11.0": + version "1.11.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-1.11.0.tgz#2f6d4f7e64eeb1e7c25b422f8df14d0c9e508e36" + integrity sha512-5xBExyXaxVyczrZvbRKEXvaTUFFq7gIM9BynXukXZE0zF3IQP/FxF4mPmmh3gJ9egafZFqByCpPTFm3dk4SY7Q== + dependencies: + "@types/eslint-visitor-keys" "^1.0.0" + "@typescript-eslint/experimental-utils" "1.11.0" + "@typescript-eslint/typescript-estree" "1.11.0" + eslint-visitor-keys "^1.0.0" + +"@typescript-eslint/typescript-estree@1.11.0": + version "1.11.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.11.0.tgz#b7b5782aab22e4b3b6d84633652c9f41e62d37d5" + integrity sha512-fquUHF5tAx1sM2OeRCC7wVxFd1iMELWMGCzOSmJ3pLzArj9+kRixdlC4d5MncuzXpjEqc6045p3KwM0o/3FuUA== + dependencies: + lodash.unescape "4.0.1" + semver "5.5.0" + JSONStream@^1.0.3: version "1.3.1" resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.1.tgz#707f761e01dae9e16f1bcf93703b78c70966579a" @@ -4694,13 +4736,6 @@ eslint-plugin-prettier@^3.1.0: dependencies: prettier-linter-helpers "^1.0.0" -eslint-plugin-typescript@^0.14.0: - version "0.14.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-typescript/-/eslint-plugin-typescript-0.14.0.tgz#068549c3f4c7f3f85d88d398c29fa96bf500884c" - integrity sha512-2u1WnnDF2mkWWgU1lFQ2RjypUlmRoBEvQN02y9u+IL12mjWlkKFGEBnVsjs9Y8190bfPQCvWly1c2rYYUSOxWw== - dependencies: - requireindex "~1.1.0" - eslint-scope@^4.0.0, eslint-scope@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" @@ -9947,11 +9982,6 @@ require-main-filename@^1.0.1: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= -requireindex@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/requireindex/-/requireindex-1.1.0.tgz#e5404b81557ef75db6e49c5a72004893fe03e162" - integrity sha1-5UBLgVV+91225JxacgBIk/4D4WI= - requires-port@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" @@ -11237,6 +11267,18 @@ tslib@1.9.3, tslib@^1.9.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== +tslib@^1.8.1: + version "1.10.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" + integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== + +tsutils@^3.7.0: + version "3.14.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.14.0.tgz#bf8d5a7bae5369331fa0f2b0a5a10bd7f7396c77" + integrity sha512-SmzGbB0l+8I0QwsPgjooFRaRvHLBLNYM8SeQ0k6rtNDru5sCGeLJcZdwilNndN+GysuFjF5EIYgN8GfFG6UeUw== + dependencies: + tslib "^1.8.1" + tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" @@ -11274,23 +11316,6 @@ typedarray@^0.0.6, typedarray@~0.0.5: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript-eslint-parser@^22.0.0: - version "22.0.0" - resolved "https://registry.yarnpkg.com/typescript-eslint-parser/-/typescript-eslint-parser-22.0.0.tgz#f5e766c9b50711b03535e29a10b45f957e3c516a" - integrity sha512-pD8D7oTeRwWvFVxK3PaY6FYAiZsuRXFkIc2+1xkwCT3NduySgCgjeAkR5/dnIWecOiFVcEHf4ypXurF02Q6Z3Q== - dependencies: - eslint-scope "^4.0.0" - eslint-visitor-keys "^1.0.0" - typescript-estree "18.0.0" - -typescript-estree@18.0.0: - version "18.0.0" - resolved "https://registry.yarnpkg.com/typescript-estree/-/typescript-estree-18.0.0.tgz#a309f6c6502c64d74b3f88c205d871a9af0b1d40" - integrity sha512-HxTWrzFyYOPWA91Ij7xL9mNUVpGTKLH2KiaBn28CMbYgX2zgWdJqU9hO7Are+pAPAqY91NxAYoaAyDDZ3rLj2A== - dependencies: - lodash.unescape "4.0.1" - semver "5.5.0" - typescript@^3.5.2: version "3.5.2" resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.2.tgz#a09e1dc69bc9551cadf17dba10ee42cf55e5d56c"