diff --git a/lib/index.js b/lib/index.js index bbfde56bbc..7601dfa070 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,97 +1,10 @@ '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: { ember: require('./utils/ember'), utils: require('./utils/utils'), diff --git a/package.json b/package.json index 7d0a8e8282..a8b64e463f 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "ember-rfc176-data": "^0.3.15", "eslint-utils": "^2.1.0", "lodash.kebabcase": "^4.1.1", + "requireindex": "^1.2.0", "snake-case": "^3.0.3" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index 55b70160d0..ad94dd1177 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5718,6 +5718,11 @@ require-main-filename@^2.0.0: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== +requireindex@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/requireindex/-/requireindex-1.2.0.tgz#3463cdb22ee151902635aa6c9535d4de9c2ef1ef" + integrity sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww== + reserved-words@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/reserved-words/-/reserved-words-0.1.2.tgz#00a0940f98cd501aeaaac316411d9adc52b31ab1"