eslint-plugin-ember
Advanced tools
Comparing version 10.4.1 to 10.4.2
'use strict'; | ||
const requireIndex = require('requireindex'); | ||
module.exports = { | ||
rules: { | ||
'alias-model-in-controller': require('./rules/alias-model-in-controller'), | ||
'avoid-leaking-state-in-ember-objects': require('./rules/avoid-leaking-state-in-ember-objects'), | ||
'avoid-using-needs-in-controllers': require('./rules/avoid-using-needs-in-controllers'), | ||
'classic-decorator-hooks': require('./rules/classic-decorator-hooks'), | ||
'classic-decorator-no-classic-methods': require('./rules/classic-decorator-no-classic-methods'), | ||
'closure-actions': require('./rules/closure-actions'), | ||
'computed-property-getters': require('./rules/computed-property-getters'), | ||
'jquery-ember-run': require('./rules/jquery-ember-run'), | ||
'named-functions-in-promises': require('./rules/named-functions-in-promises'), | ||
'new-module-imports': require('./rules/new-module-imports'), | ||
'no-actions-hash': require('./rules/no-actions-hash'), | ||
'no-arrow-function-computed-properties': require('./rules/no-arrow-function-computed-properties'), | ||
'no-assignment-of-untracked-properties-used-in-tracking-contexts': require('./rules/no-assignment-of-untracked-properties-used-in-tracking-contexts'), | ||
'no-attrs-in-components': require('./rules/no-attrs-in-components'), | ||
'no-attrs-snapshot': require('./rules/no-attrs-snapshot'), | ||
'no-capital-letters-in-routes': require('./rules/no-capital-letters-in-routes'), | ||
'no-classic-classes': require('./rules/no-classic-classes'), | ||
'no-classic-components': require('./rules/no-classic-components'), | ||
'no-component-lifecycle-hooks': require('./rules/no-component-lifecycle-hooks'), | ||
'no-computed-properties-in-native-classes': require('./rules/no-computed-properties-in-native-classes'), | ||
'no-controller-access-in-routes': require('./rules/no-controller-access-in-routes'), | ||
'no-controllers': require('./rules/no-controllers'), | ||
'no-current-route-name': require('./rules/no-current-route-name'), | ||
'no-deeply-nested-dependent-keys-with-each': require('./rules/no-deeply-nested-dependent-keys-with-each'), | ||
'no-duplicate-dependent-keys': require('./rules/no-duplicate-dependent-keys'), | ||
'no-ember-super-in-es-classes': require('./rules/no-ember-super-in-es-classes'), | ||
'no-ember-testing-in-module-scope': require('./rules/no-ember-testing-in-module-scope'), | ||
'no-empty-attrs': require('./rules/no-empty-attrs'), | ||
'no-empty-glimmer-component-classes': require('./rules/no-empty-glimmer-component-classes'), | ||
'no-function-prototype-extensions': require('./rules/no-function-prototype-extensions'), | ||
'no-get-with-default': require('./rules/no-get-with-default'), | ||
'no-get': require('./rules/no-get'), | ||
'no-global-jquery': require('./rules/no-global-jquery'), | ||
'no-html-safe': require('./rules/no-html-safe'), | ||
'no-incorrect-calls-with-inline-anonymous-functions': require('./rules/no-incorrect-calls-with-inline-anonymous-functions'), | ||
'no-incorrect-computed-macros': require('./rules/no-incorrect-computed-macros'), | ||
'no-invalid-debug-function-arguments': require('./rules/no-invalid-debug-function-arguments'), | ||
'no-invalid-dependent-keys': require('./rules/no-invalid-dependent-keys'), | ||
'no-invalid-test-waiters': require('./rules/no-invalid-test-waiters'), | ||
'no-jquery': require('./rules/no-jquery'), | ||
'no-legacy-test-waiters': require('./rules/no-legacy-test-waiters'), | ||
'no-mixins': require('./rules/no-mixins'), | ||
'no-new-mixins': require('./rules/no-new-mixins'), | ||
'no-noop-setup-on-error-in-before': require('./rules/no-noop-setup-on-error-in-before'), | ||
'no-observers': require('./rules/no-observers'), | ||
'no-old-shims': require('./rules/no-old-shims'), | ||
'no-on-calls-in-components': require('./rules/no-on-calls-in-components'), | ||
'no-pause-test': require('./rules/no-pause-test'), | ||
'no-private-routing-service': require('./rules/no-private-routing-service'), | ||
'no-proxies': require('./rules/no-proxies'), | ||
'no-replace-test-comments': require('./rules/no-replace-test-comments'), | ||
'no-restricted-resolver-tests': require('./rules/no-restricted-resolver-tests'), | ||
'no-restricted-service-injections': require('./rules/no-restricted-service-injections'), | ||
'no-settled-after-test-helper': require('./rules/no-settled-after-test-helper'), | ||
'no-shadow-route-definition': require('./rules/no-shadow-route-definition'), | ||
'no-side-effects': require('./rules/no-side-effects'), | ||
'no-string-prototype-extensions': require('./rules/no-string-prototype-extensions'), | ||
'no-test-and-then': require('./rules/no-test-and-then'), | ||
'no-test-import-export': require('./rules/no-test-import-export'), | ||
'no-test-module-for': require('./rules/no-test-module-for'), | ||
'no-test-support-import': require('./rules/no-test-support-import'), | ||
'no-test-this-render': require('./rules/no-test-this-render'), | ||
'no-try-invoke': require('./rules/no-try-invoke'), | ||
'no-unnecessary-index-route': require('./rules/no-unnecessary-index-route'), | ||
'no-unnecessary-route-path-option': require('./rules/no-unnecessary-route-path-option'), | ||
'no-unnecessary-service-injection-argument': require('./rules/no-unnecessary-service-injection-argument'), | ||
'no-unused-services': require('./rules/no-unused-services'), | ||
'no-volatile-computed-properties': require('./rules/no-volatile-computed-properties'), | ||
'order-in-components': require('./rules/order-in-components'), | ||
'order-in-controllers': require('./rules/order-in-controllers'), | ||
'order-in-models': require('./rules/order-in-models'), | ||
'order-in-routes': require('./rules/order-in-routes'), | ||
'prefer-ember-test-helpers': require('./rules/prefer-ember-test-helpers'), | ||
'require-computed-macros': require('./rules/require-computed-macros'), | ||
'require-computed-property-dependencies': require('./rules/require-computed-property-dependencies'), | ||
'require-fetch-import': require('./rules/require-fetch-import'), | ||
'require-return-from-computed': require('./rules/require-return-from-computed'), | ||
'require-super-in-lifecycle-hooks': require('./rules/require-super-in-lifecycle-hooks'), | ||
'require-tagless-components': require('./rules/require-tagless-components'), | ||
'require-valid-css-selector-in-test-helpers': require('./rules/require-valid-css-selector-in-test-helpers'), | ||
'route-path-style': require('./rules/route-path-style'), | ||
'routes-segments-snake-case': require('./rules/routes-segments-snake-case'), | ||
'use-brace-expansion': require('./rules/use-brace-expansion'), | ||
'use-ember-data-rfc-395-imports': require('./rules/use-ember-data-rfc-395-imports'), | ||
'use-ember-get-and-set': require('./rules/use-ember-get-and-set'), | ||
}, | ||
configs: { | ||
base: require('./config/base'), | ||
recommended: require('./config/recommended'), | ||
}, | ||
rules: requireIndex(`${__dirname}/rules`), | ||
configs: requireIndex(`${__dirname}/config`), | ||
utils: { | ||
@@ -96,0 +9,0 @@ ember: require('./utils/ember'), |
@@ -17,4 +17,3 @@ 'use strict'; | ||
recommended: false, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/alias-model-in-controller.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/alias-model-in-controller.md', | ||
}, | ||
@@ -21,0 +20,0 @@ fixable: null, |
@@ -58,4 +58,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/avoid-leaking-state-in-ember-objects.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/avoid-leaking-state-in-ember-objects.md', | ||
}, | ||
@@ -62,0 +61,0 @@ fixable: null, |
@@ -16,4 +16,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/avoid-using-needs-in-controllers.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/avoid-using-needs-in-controllers.md', | ||
}, | ||
@@ -20,0 +19,0 @@ fixable: null, |
@@ -19,4 +19,3 @@ const ERROR_MESSAGE_INIT_IN_NON_CLASSIC = | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/classic-decorator-hooks.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/classic-decorator-hooks.md', | ||
}, | ||
@@ -23,0 +22,0 @@ fixable: null, |
@@ -31,4 +31,3 @@ const disallowedMethods = new Set([ | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/classic-decorator-no-classic-methods.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/classic-decorator-no-classic-methods.md', | ||
}, | ||
@@ -35,0 +34,0 @@ fixable: null, |
@@ -18,4 +18,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/closure-actions.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/closure-actions.md', | ||
}, | ||
@@ -22,0 +21,0 @@ fixable: null, |
@@ -23,4 +23,3 @@ 'use strict'; | ||
recommended: false, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/computed-property-getters.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/computed-property-getters.md', | ||
}, | ||
@@ -27,0 +26,0 @@ fixable: null, |
@@ -39,4 +39,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/jquery-ember-run.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/jquery-ember-run.md', | ||
}, | ||
@@ -43,0 +42,0 @@ fixable: null, |
@@ -16,4 +16,3 @@ 'use strict'; | ||
recommended: false, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/named-functions-in-promises.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/named-functions-in-promises.md', | ||
}, | ||
@@ -20,0 +19,0 @@ fixable: null, |
@@ -32,4 +32,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/new-module-imports.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/new-module-imports.md', | ||
}, | ||
@@ -36,0 +35,0 @@ schema: [], |
@@ -14,4 +14,3 @@ const ember = require('../utils/ember'); | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-actions-hash.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-actions-hash.md', | ||
}, | ||
@@ -18,0 +17,0 @@ fixable: null, |
@@ -18,4 +18,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-arrow-function-computed-properties.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-arrow-function-computed-properties.md', | ||
}, | ||
@@ -22,0 +21,0 @@ schema: [ |
@@ -94,4 +94,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-assignment-of-untracked-properties-used-in-tracking-contexts.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-assignment-of-untracked-properties-used-in-tracking-contexts.md', | ||
}, | ||
@@ -98,0 +97,0 @@ fixable: 'code', |
@@ -19,4 +19,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-attrs-in-components.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-attrs-in-components.md', | ||
}, | ||
@@ -23,0 +22,0 @@ fixable: null, |
@@ -28,4 +28,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-attrs-snapshot.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-attrs-snapshot.md', | ||
}, | ||
@@ -32,0 +31,0 @@ fixable: null, |
@@ -17,4 +17,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-capital-letters-in-routes.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-capital-letters-in-routes.md', | ||
}, | ||
@@ -21,0 +20,0 @@ fixable: null, |
@@ -47,4 +47,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-classic-classes.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-classic-classes.md', | ||
}, | ||
@@ -51,0 +50,0 @@ fixable: null, |
@@ -16,4 +16,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-classic-components.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-classic-components.md', | ||
}, | ||
@@ -20,0 +19,0 @@ fixable: null, |
@@ -28,4 +28,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-component-lifecycle-hooks.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-component-lifecycle-hooks.md', | ||
}, | ||
@@ -32,0 +31,0 @@ fixable: null, // or "code" or "whitespace" |
@@ -36,4 +36,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-computed-properties-in-native-classes.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-computed-properties-in-native-classes.md', | ||
}, | ||
@@ -40,0 +39,0 @@ fixable: null, |
@@ -22,4 +22,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-controller-access-in-routes.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-controller-access-in-routes.md', | ||
}, | ||
@@ -26,0 +25,0 @@ fixable: null, |
@@ -16,4 +16,3 @@ const ember = require('../utils/ember'); | ||
recommended: false, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-controllers.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-controllers.md', | ||
}, | ||
@@ -20,0 +19,0 @@ fixable: null, |
@@ -12,4 +12,3 @@ 'use strict'; | ||
recommended: false, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-current-route-name.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-current-route-name.md', | ||
}, | ||
@@ -16,0 +15,0 @@ fixable: null, |
@@ -20,4 +20,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-deeply-nested-dependent-keys-with-each.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-deeply-nested-dependent-keys-with-each.md', | ||
}, | ||
@@ -24,0 +23,0 @@ fixable: null, |
@@ -21,4 +21,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-duplicate-dependent-keys.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-duplicate-dependent-keys.md', | ||
}, | ||
@@ -25,0 +24,0 @@ fixable: 'code', |
@@ -10,4 +10,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-ember-super-in-es-classes.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-ember-super-in-es-classes.md', | ||
}, | ||
@@ -14,0 +13,0 @@ fixable: 'code', |
@@ -19,4 +19,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-ember-testing-in-module-scope.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-ember-testing-in-module-scope.md', | ||
}, | ||
@@ -23,0 +22,0 @@ fixable: null, |
@@ -16,4 +16,3 @@ 'use strict'; | ||
recommended: false, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-empty-attrs.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-empty-attrs.md', | ||
}, | ||
@@ -20,0 +19,0 @@ fixable: null, |
@@ -18,4 +18,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-empty-glimmer-component-classes.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-empty-glimmer-component-classes.md', | ||
}, | ||
@@ -22,0 +21,0 @@ fixable: null, |
@@ -16,4 +16,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-function-prototype-extensions.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-function-prototype-extensions.md', | ||
}, | ||
@@ -20,0 +19,0 @@ fixable: null, |
@@ -16,4 +16,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-get-with-default.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-get-with-default.md', | ||
}, | ||
@@ -20,0 +19,0 @@ fixable: 'code', |
@@ -19,4 +19,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-global-jquery.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-global-jquery.md', | ||
}, | ||
@@ -23,0 +22,0 @@ fixable: null, |
@@ -17,4 +17,3 @@ 'use strict'; | ||
recommended: false, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-html-safe.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-html-safe.md', | ||
}, | ||
@@ -21,0 +20,0 @@ fixable: null, |
@@ -30,4 +30,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-incorrect-calls-with-inline-anonymous-functions.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-incorrect-calls-with-inline-anonymous-functions.md', | ||
}, | ||
@@ -34,0 +33,0 @@ schema: [], |
@@ -15,4 +15,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-incorrect-computed-macros.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-incorrect-computed-macros.md', | ||
}, | ||
@@ -19,0 +18,0 @@ fixable: 'code', |
@@ -23,4 +23,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-invalid-debug-function-arguments.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-invalid-debug-function-arguments.md', | ||
}, | ||
@@ -27,0 +26,0 @@ fixable: null, |
@@ -45,4 +45,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-invalid-dependent-keys.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-invalid-dependent-keys.md', | ||
}, | ||
@@ -49,0 +48,0 @@ fixable: 'code', |
@@ -30,4 +30,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-invalid-test-waiters.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-invalid-test-waiters.md', | ||
}, | ||
@@ -34,0 +33,0 @@ fixable: null, |
@@ -15,4 +15,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-legacy-test-waiters.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-legacy-test-waiters.md', | ||
}, | ||
@@ -19,0 +18,0 @@ fixable: null, |
@@ -18,4 +18,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-new-mixins.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-new-mixins.md', | ||
}, | ||
@@ -22,0 +21,0 @@ fixable: null, |
@@ -17,4 +17,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-noop-setup-on-error-in-before.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-noop-setup-on-error-in-before.md', | ||
}, | ||
@@ -21,0 +20,0 @@ fixable: 'code', |
@@ -20,4 +20,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-observers.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-observers.md', | ||
}, | ||
@@ -83,15 +82,29 @@ fixable: null, | ||
ImportDeclaration(node) { | ||
if (node.source.value === 'ember') { | ||
importedEmberName = importedEmberName || getImportIdentifier(node, 'ember'); | ||
} else if (node.source.value === '@ember/object') { | ||
importedObserverName = | ||
importedObserverName || getImportIdentifier(node, '@ember/object', 'observer'); | ||
} else if (node.source.value === '@ember-decorators/object') { | ||
importedObservesName = | ||
importedObservesName || | ||
getImportIdentifier(node, '@ember-decorators/object', 'observes'); | ||
} else if (node.source.value === '@ember/object/observers') { | ||
importedAddObserverName = | ||
importedAddObserverName || | ||
getImportIdentifier(node, '@ember/object/observers', 'addObserver'); | ||
switch (node.source.value) { | ||
case 'ember': { | ||
importedEmberName = importedEmberName || getImportIdentifier(node, 'ember'); | ||
break; | ||
} | ||
case '@ember/object': { | ||
importedObserverName = | ||
importedObserverName || getImportIdentifier(node, '@ember/object', 'observer'); | ||
break; | ||
} | ||
case '@ember-decorators/object': { | ||
importedObservesName = | ||
importedObservesName || | ||
getImportIdentifier(node, '@ember-decorators/object', 'observes'); | ||
break; | ||
} | ||
case '@ember/object/observers': { | ||
importedAddObserverName = | ||
importedAddObserverName || | ||
getImportIdentifier(node, '@ember/object/observers', 'addObserver'); | ||
break; | ||
} | ||
// No default | ||
} | ||
@@ -98,0 +111,0 @@ }, |
@@ -258,4 +258,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-old-shims.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-old-shims.md', | ||
}, | ||
@@ -262,0 +261,0 @@ fixable: 'code', |
@@ -18,4 +18,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-on-calls-in-components.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-on-calls-in-components.md', | ||
}, | ||
@@ -22,0 +21,0 @@ fixable: null, |
@@ -20,4 +20,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-pause-test.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-pause-test.md', | ||
}, | ||
@@ -24,0 +23,0 @@ fixable: null, |
@@ -28,4 +28,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-private-routing-service.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-private-routing-service.md', | ||
}, | ||
@@ -32,0 +31,0 @@ fixable: null, |
@@ -18,4 +18,3 @@ 'use strict'; | ||
recommended: false, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-replace-test-comments.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-replace-test-comments.md', | ||
}, | ||
@@ -22,0 +21,0 @@ fixable: null, |
@@ -80,4 +80,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-restricted-resolver-tests.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-restricted-resolver-tests.md', | ||
}, | ||
@@ -84,0 +83,0 @@ fixable: null, |
@@ -17,4 +17,3 @@ 'use strict'; | ||
category: 'Services', | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-restricted-service-injections.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-restricted-service-injections.md', | ||
}, | ||
@@ -21,0 +20,0 @@ schema: { |
@@ -30,4 +30,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-settled-after-test-helper.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-settled-after-test-helper.md', | ||
}, | ||
@@ -34,0 +33,0 @@ fixable: 'code', |
@@ -44,4 +44,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-shadow-route-definition.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-shadow-route-definition.md', | ||
}, | ||
@@ -48,0 +47,0 @@ fixable: null, |
@@ -91,2 +91,4 @@ 'use strict'; | ||
return memberExpressionBeginsWithThis(node.object); | ||
} else if (node.type === 'ChainExpression') { | ||
return memberExpressionBeginsWithThis(node.expression); | ||
} | ||
@@ -144,4 +146,3 @@ return false; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-side-effects.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-side-effects.md', | ||
}, | ||
@@ -148,0 +149,0 @@ fixable: null, |
@@ -26,4 +26,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-string-prototype-extensions.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-string-prototype-extensions.md', | ||
}, | ||
@@ -30,0 +29,0 @@ fixable: null, |
@@ -19,4 +19,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-test-and-then.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-test-and-then.md', | ||
}, | ||
@@ -23,0 +22,0 @@ fixable: null, |
@@ -22,4 +22,3 @@ /** | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-test-import-export.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-test-import-export.md', | ||
}, | ||
@@ -26,0 +25,0 @@ schema: [], |
@@ -21,4 +21,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-test-module-for.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-test-module-for.md', | ||
}, | ||
@@ -25,0 +24,0 @@ fixable: null, |
@@ -21,4 +21,3 @@ /** | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-test-support-import.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-test-support-import.md', | ||
}, | ||
@@ -25,0 +24,0 @@ schema: [], |
@@ -22,4 +22,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-test-this-render.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-test-this-render.md', | ||
}, | ||
@@ -26,0 +25,0 @@ fixable: null, |
@@ -16,4 +16,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-try-invoke.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-try-invoke.md', | ||
}, | ||
@@ -20,0 +19,0 @@ fixable: null, |
@@ -19,4 +19,3 @@ 'use strict'; | ||
recommended: false, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-unnecessary-index-route.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-unnecessary-index-route.md', | ||
}, | ||
@@ -23,0 +22,0 @@ fixable: null, |
@@ -21,4 +21,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-unnecessary-route-path-option.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-unnecessary-route-path-option.md', | ||
}, | ||
@@ -25,0 +24,0 @@ fixable: 'code', |
@@ -21,4 +21,3 @@ 'use strict'; | ||
recommended: false, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-unnecessary-service-injection-argument.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-unnecessary-service-injection-argument.md', | ||
}, | ||
@@ -25,0 +24,0 @@ fixable: 'code', |
@@ -31,7 +31,6 @@ 'use strict'; | ||
docs: { | ||
description: 'disallow unused service injections', | ||
description: 'disallow unused service injections (see rule doc for limitations)', | ||
category: 'Services', | ||
recommended: false, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-unused-services.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-unused-services.md', | ||
}, | ||
@@ -41,4 +40,3 @@ fixable: null, | ||
messages: { | ||
main: | ||
'The service `{{name}}` is not referenced in this JS file and might be unused (note: it could still be used in a corresponding handlebars template file, mixin, or parent/child class).', | ||
main: 'The service `{{name}}` is not referenced in this JS file and might be unused (note: it could still be used in a corresponding handlebars template file, mixin, or parent/child class).', | ||
removeServiceInjection: 'Remove the service injection.', | ||
@@ -45,0 +43,0 @@ }, |
@@ -18,4 +18,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-volatile-computed-properties.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-volatile-computed-properties.md', | ||
}, | ||
@@ -22,0 +21,0 @@ schema: [], |
@@ -45,4 +45,3 @@ 'use strict'; | ||
recommended: false, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/order-in-components.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/order-in-components.md', | ||
}, | ||
@@ -70,3 +69,3 @@ fixable: 'code', | ||
: ORDER; | ||
order = order.slice(0); | ||
order = [...order]; | ||
const indexOfLifecycleHook = order.indexOf('lifecycle-hook'); | ||
@@ -73,0 +72,0 @@ |
@@ -36,4 +36,3 @@ 'use strict'; | ||
recommended: false, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/order-in-controllers.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/order-in-controllers.md', | ||
}, | ||
@@ -40,0 +39,0 @@ fixable: 'code', |
@@ -30,4 +30,3 @@ 'use strict'; | ||
recommended: false, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/order-in-models.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/order-in-models.md', | ||
}, | ||
@@ -34,0 +33,0 @@ fixable: 'code', |
@@ -43,4 +43,3 @@ 'use strict'; | ||
recommended: false, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/order-in-routes.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/order-in-routes.md', | ||
}, | ||
@@ -68,3 +67,3 @@ fixable: 'code', | ||
: ORDER; | ||
order = order.slice(0); | ||
order = [...order]; | ||
const indexOfLifecycleHook = order.indexOf('lifecycle-hook'); | ||
@@ -71,0 +70,0 @@ |
@@ -17,4 +17,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/prefer-ember-test-helpers.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/prefer-ember-test-helpers.md', | ||
}, | ||
@@ -21,0 +20,0 @@ schema: [], |
@@ -132,4 +132,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/require-computed-macros.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/require-computed-macros.md', | ||
}, | ||
@@ -309,12 +308,29 @@ fixable: 'code', | ||
) { | ||
if (statement.operator === '===') { | ||
reportBinaryExpression(nodeToReport, statement, 'equal'); | ||
} else if (statement.operator === '>') { | ||
reportBinaryExpression(nodeToReport, statement, 'gt'); | ||
} else if (statement.operator === '>=') { | ||
reportBinaryExpression(nodeToReport, statement, 'gte'); | ||
} else if (statement.operator === '<') { | ||
reportBinaryExpression(nodeToReport, statement, 'lt'); | ||
} else if (statement.operator === '<=') { | ||
reportBinaryExpression(nodeToReport, statement, 'lte'); | ||
switch (statement.operator) { | ||
case '===': { | ||
reportBinaryExpression(nodeToReport, statement, 'equal'); | ||
break; | ||
} | ||
case '>': { | ||
reportBinaryExpression(nodeToReport, statement, 'gt'); | ||
break; | ||
} | ||
case '>=': { | ||
reportBinaryExpression(nodeToReport, statement, 'gte'); | ||
break; | ||
} | ||
case '<': { | ||
reportBinaryExpression(nodeToReport, statement, 'lt'); | ||
break; | ||
} | ||
case '<=': { | ||
reportBinaryExpression(nodeToReport, statement, 'lte'); | ||
break; | ||
} | ||
// No default | ||
} | ||
@@ -321,0 +337,0 @@ } else if (propertyGetterUtils.isSimpleThisExpression(statement)) { |
@@ -288,4 +288,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/require-computed-property-dependencies.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/require-computed-property-dependencies.md', | ||
}, | ||
@@ -340,5 +339,4 @@ | ||
const computedPropertyFunctionBody = computedPropertyUtils.getComputedPropertyFunctionBody( | ||
node | ||
); | ||
const computedPropertyFunctionBody = | ||
computedPropertyUtils.getComputedPropertyFunctionBody(node); | ||
@@ -392,8 +390,8 @@ const usedKeys1 = javascriptUtils.flatMap( | ||
const missingDependenciesAsArgumentsForDynamicKeys = declaredDependencies.dynamicKeys.map( | ||
(dynamicKey) => sourceCode.getText(dynamicKey) | ||
); | ||
const missingDependenciesAsArgumentsForStringKeys = computedPropertyDependentKeyUtils.collapseKeys( | ||
removeRedundantKeys([...undeclaredKeys, ...expandedDeclaredKeys]) | ||
); | ||
const missingDependenciesAsArgumentsForDynamicKeys = | ||
declaredDependencies.dynamicKeys.map((dynamicKey) => sourceCode.getText(dynamicKey)); | ||
const missingDependenciesAsArgumentsForStringKeys = | ||
computedPropertyDependentKeyUtils.collapseKeys( | ||
removeRedundantKeys([...undeclaredKeys, ...expandedDeclaredKeys]) | ||
); | ||
@@ -400,0 +398,0 @@ const missingDependenciesAsArguments = [ |
@@ -14,4 +14,3 @@ 'use strict'; | ||
recommended: false, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/require-fetch-import.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/require-fetch-import.md', | ||
}, | ||
@@ -18,0 +17,0 @@ fixable: null, |
@@ -23,4 +23,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/require-return-from-computed.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/require-return-from-computed.md', | ||
}, | ||
@@ -27,0 +26,0 @@ fixable: null, |
@@ -65,4 +65,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/require-super-in-lifecycle-hooks.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/require-super-in-lifecycle-hooks.md', | ||
}, | ||
@@ -191,14 +190,34 @@ fixable: 'code', | ||
'ClassDeclaration:exit'(node) { | ||
if (currentEmberComponent === node) { | ||
currentEmberComponent = null; | ||
} else if (currentEmberController === node) { | ||
currentEmberController = null; | ||
} else if (currentEmberRoute === node) { | ||
currentEmberRoute = null; | ||
} else if (currentEmberMixin === node) { | ||
currentEmberMixin = null; | ||
} else if (currentEmberService === node) { | ||
currentEmberService = null; | ||
} else if (currentGlimmerComponent === node) { | ||
currentGlimmerComponent = null; | ||
switch (node) { | ||
case currentEmberComponent: { | ||
currentEmberComponent = null; | ||
break; | ||
} | ||
case currentEmberController: { | ||
currentEmberController = null; | ||
break; | ||
} | ||
case currentEmberRoute: { | ||
currentEmberRoute = null; | ||
break; | ||
} | ||
case currentEmberMixin: { | ||
currentEmberMixin = null; | ||
break; | ||
} | ||
case currentEmberService: { | ||
currentEmberService = null; | ||
break; | ||
} | ||
case currentGlimmerComponent: { | ||
currentGlimmerComponent = null; | ||
break; | ||
} | ||
// No default | ||
} | ||
@@ -205,0 +224,0 @@ }, |
@@ -97,4 +97,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/require-tagless-components.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/require-tagless-components.md', | ||
}, | ||
@@ -101,0 +100,0 @@ fixable: null, |
@@ -125,4 +125,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/require-valid-css-selector-in-test-helpers.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/require-valid-css-selector-in-test-helpers.md', | ||
}, | ||
@@ -129,0 +128,0 @@ fixable: 'code', |
@@ -22,4 +22,3 @@ 'use strict'; | ||
recommended: false, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/route-path-style.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/route-path-style.md', | ||
suggestion: true, | ||
@@ -26,0 +25,0 @@ }, |
@@ -23,4 +23,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/routes-segments-snake-case.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/routes-segments-snake-case.md', | ||
}, | ||
@@ -27,0 +26,0 @@ fixable: null, |
@@ -20,4 +20,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/use-brace-expansion.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/use-brace-expansion.md', | ||
}, | ||
@@ -24,0 +23,0 @@ fixable: null, |
@@ -70,4 +70,3 @@ 'use strict'; | ||
recommended: true, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/use-ember-data-rfc-395-imports.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/use-ember-data-rfc-395-imports.md', | ||
}, | ||
@@ -74,0 +73,0 @@ fixable: 'code', |
@@ -22,4 +22,3 @@ 'use strict'; | ||
recommended: false, | ||
url: | ||
'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/use-ember-get-and-set.md', | ||
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/use-ember-get-and-set.md', | ||
}, | ||
@@ -26,0 +25,0 @@ fixable: 'code', |
@@ -93,7 +93,8 @@ 'use strict'; | ||
// iteration 2 (["bar", "baz"]): duplicate acc once, resulting in `[["foo"], ["foo"]] | ||
javascriptUtils.duplicateArrays(acc, nextParts.length - 1).map((base, index) => | ||
// evenly distribute the parts across the repeated base keys. | ||
// nextParts[0 % 2] => "bar" | ||
// nextParts[1 % 2] => "baz" | ||
base.concat(nextParts[index % nextParts.length]) | ||
javascriptUtils.duplicateArrays(acc, nextParts.length - 1).map( | ||
(base, index) => | ||
// evenly distribute the parts across the repeated base keys. | ||
// nextParts[0 % 2] => "bar" | ||
// nextParts[1 % 2] => "baz" | ||
base.concat(nextParts[index % nextParts.length]) // eslint-disable-line unicorn/prefer-spread | ||
), | ||
@@ -319,2 +320,6 @@ [[]] | ||
function getComputedPropertyDependentKeys(node, computedDependenciesConfig = null) { | ||
if (node.type === 'ChainExpression') { | ||
return getComputedPropertyDependentKeys(node.expression); | ||
} | ||
if (!node.arguments) { | ||
@@ -321,0 +326,0 @@ return []; |
@@ -118,8 +118,3 @@ 'use strict'; | ||
const calleeNode = node.value.callee; | ||
return ( | ||
(types.isIdentifier(calleeNode) && calleeNode.name === type) || | ||
(types.isMemberExpression(calleeNode) && | ||
types.isIdentifier(calleeNode.property) && | ||
calleeNode.property.name === type) | ||
); | ||
return types.isIdentifier(calleeNode) && calleeNode.name === type; | ||
} else if ((types.isClassProperty(node) || types.isMethodDefinition(node)) && node.decorators) { | ||
@@ -340,8 +335,46 @@ return node.decorators.some((decorator) => { | ||
function isInjectedControllerProp(node) { | ||
return isPropOfType(node, 'controller'); | ||
/** | ||
* Checks if a node is a controller injection. Looks for: | ||
* * controller() | ||
* * Ember.inject.controller() | ||
* @param {node} node | ||
* @param {string} importedEmberName name that `Ember` is imported under | ||
* @returns | ||
*/ | ||
function isInjectedControllerProp(node, importedEmberName) { | ||
return ( | ||
isPropOfType(node, 'controller') || | ||
(types.isProperty(node) && | ||
types.isCallExpression(node.value) && | ||
types.isMemberExpression(node.value.callee) && | ||
types.isMemberExpression(node.value.callee.object) && | ||
types.isIdentifier(node.value.callee.object.object) && | ||
node.value.callee.object.object.name === importedEmberName && | ||
types.isIdentifier(node.value.callee.object.property) && | ||
node.value.callee.object.property.name === 'inject' && | ||
types.isIdentifier(node.value.callee.property) && | ||
node.value.callee.property.name === 'controller') | ||
); | ||
} | ||
function isObserverProp(node) { | ||
return isPropOfType(node, 'observer'); | ||
/** | ||
* Checks if a node is an observer prop. Looks for: | ||
* * observer() | ||
* * Ember.observer() | ||
* @param {node} node | ||
* @param {string} importedEmberName name that `Ember` is imported under | ||
* @returns | ||
*/ | ||
function isObserverProp(node, importedEmberName) { | ||
return ( | ||
isPropOfType(node, 'observer') || | ||
(types.isProperty(node) && | ||
types.isCallExpression(node.value) && | ||
types.isMemberExpression(node.value.callee) && | ||
types.isIdentifier(node.value.callee.object) && | ||
node.value.callee.object.name === importedEmberName && | ||
types.isIdentifier(node.value.callee.property) && | ||
types.isIdentifier(node.value.callee.property) && | ||
node.value.callee.property.name === 'observer') | ||
); | ||
} | ||
@@ -590,3 +623,3 @@ | ||
function isSingleLineFn(property) { | ||
function isSingleLineFn(property, importedEmberName) { | ||
return ( | ||
@@ -597,4 +630,4 @@ (types.isMethodDefinition(property) && utils.getSize(property) === 1) || | ||
utils.getSize(property.value) === 1 && | ||
!isObserverProp(property) && | ||
(isComputedProp(property.value, 'Ember', 'computed', { includeSuffix: true }) || | ||
!isObserverProp(property, importedEmberName) && | ||
(isComputedProp(property.value, importedEmberName, 'computed', { includeSuffix: true }) || | ||
!types.isCallWithFunctionExpression(property.value))) | ||
@@ -604,3 +637,3 @@ ); | ||
function isMultiLineFn(property) { | ||
function isMultiLineFn(property, importedEmberName) { | ||
return ( | ||
@@ -611,4 +644,4 @@ (types.isMethodDefinition(property) && utils.getSize(property) > 1) || | ||
utils.getSize(property.value) > 1 && | ||
!isObserverProp(property) && | ||
(isComputedProp(property.value, 'Ember', 'computed', { includeSuffix: true }) || | ||
!isObserverProp(property, importedEmberName) && | ||
(isComputedProp(property.value, importedEmberName, 'computed', { includeSuffix: true }) || | ||
!types.isCallWithFunctionExpression(property.value))) | ||
@@ -697,3 +730,3 @@ ); | ||
return unwrappedExpressions.reduce((acc, cur) => acc.concat(cur), []); | ||
return unwrappedExpressions.reduce((acc, cur) => acc.concat(cur), []); // eslint-disable-line unicorn/prefer-spread | ||
} | ||
@@ -700,0 +733,0 @@ |
@@ -19,3 +19,3 @@ 'use strict'; | ||
for (let i = 0; i <= times; i++) { | ||
result.push(...arr.map((a) => a.slice(0))); | ||
result.push(...arr.map((a) => a.slice(0))); // eslint-disable-line unicorn/prefer-spread | ||
} | ||
@@ -40,3 +40,3 @@ return result; | ||
return arr.reduce((acc, val) => acc.concat(val)); | ||
return arr.reduce((acc, val) => acc.concat(val)); // eslint-disable-line unicorn/prefer-spread | ||
} | ||
@@ -54,3 +54,3 @@ | ||
function flatMap(array, callback) { | ||
return array.reduce((result, item, index) => result.concat(callback(item, index)), []); | ||
return array.reduce((result, item, index) => result.concat(callback(item, index)), []); // eslint-disable-line unicorn/prefer-spread | ||
} | ||
@@ -57,0 +57,0 @@ |
@@ -48,2 +48,6 @@ const types = require('./types'); | ||
if (node.type === 'ChainExpression') { | ||
return isSimpleThisExpression(node.expression); | ||
} | ||
if (!(types.isMemberExpression(node) || types.isOptionalMemberExpression(node))) { | ||
@@ -50,0 +54,0 @@ return false; |
@@ -60,3 +60,3 @@ 'use strict'; | ||
if (ember.isInjectedControllerProp(node)) { | ||
if (ember.isInjectedControllerProp(node, importedEmberName)) { | ||
return 'controller'; | ||
@@ -102,3 +102,3 @@ } | ||
if (ember.isObserverProp(node)) { | ||
if (ember.isObserverProp(node, importedEmberName)) { | ||
return 'observer'; | ||
@@ -111,7 +111,7 @@ } | ||
if (ember.isSingleLineFn(node)) { | ||
if (ember.isSingleLineFn(node, importedEmberName)) { | ||
return 'single-line-function'; | ||
} | ||
if (ember.isMultiLineFn(node)) { | ||
if (ember.isMultiLineFn(node, importedEmberName)) { | ||
return 'multi-line-function'; | ||
@@ -138,3 +138,4 @@ } | ||
if (node.type === 'ExperimentalSpreadProperty') { | ||
// Handle both babel-eslint and @babel/eslint-parser | ||
if (node.type === 'ExperimentalSpreadProperty' || node.type === 'SpreadElement') { | ||
return 'spread'; | ||
@@ -332,3 +333,3 @@ } | ||
function addBackwardsPosition(order, newPosition, targetPosition) { | ||
const positionOrder = order.slice(); | ||
const positionOrder = [...order]; | ||
@@ -335,0 +336,0 @@ const containsPosition = positionOrder.some((position) => { |
@@ -229,2 +229,4 @@ 'use strict'; | ||
return `${getName(node.object)}.${getName(node.property)}`; | ||
} else if (node.type === 'ChainExpression') { | ||
return getName(node.expression); | ||
} | ||
@@ -231,0 +233,0 @@ return undefined; |
{ | ||
"name": "eslint-plugin-ember", | ||
"version": "10.4.1", | ||
"version": "10.4.2", | ||
"description": "Eslint plugin for Ember.js apps", | ||
@@ -65,6 +65,9 @@ "keywords": [ | ||
"lodash.kebabcase": "^4.1.1", | ||
"requireindex": "^1.2.0", | ||
"snake-case": "^3.0.3" | ||
}, | ||
"devDependencies": { | ||
"babel-eslint": "^10.1.0", | ||
"@babel/eslint-parser": "^7.13.14", | ||
"@babel/plugin-proposal-class-properties": "^7.13.0", | ||
"@babel/plugin-proposal-decorators": "^7.13.15", | ||
"eslint": "^7.8.1", | ||
@@ -80,3 +83,3 @@ "eslint-config-prettier": "^8.0.0", | ||
"eslint-plugin-prettier": "^3.1.4", | ||
"eslint-plugin-unicorn": "^29.0.0", | ||
"eslint-plugin-unicorn": "^31.0.0", | ||
"jest": "^26.4.2", | ||
@@ -83,0 +86,0 @@ "jquery": "^3.5.1", |
@@ -179,3 +179,3 @@ # eslint-plugin-ember | ||
| :wrench: | [no-unnecessary-service-injection-argument](./docs/rules/no-unnecessary-service-injection-argument.md) | disallow unnecessary argument when injecting services | | ||
| | [no-unused-services](./docs/rules/no-unused-services.md) | disallow unused service injections | | ||
| | [no-unused-services](./docs/rules/no-unused-services.md) | disallow unused service injections (see rule doc for limitations) | | ||
@@ -182,0 +182,0 @@ ### Stylistic Issues |
Sorry, the diff of this file is too big to display
525213
8
23
11120
+ Addedrequireindex@^1.2.0
+ Addedrequireindex@1.2.0(transitive)