Repository: ember-cli/eslint-plugin-ember
Pull request #1518 (2022-07-14 22:56:34)

Remove `base` config
There's no reason to have a "base" config. Other ESLint plugins do not offer an equivalent config. The only configuration we should offer is `recommended`.

If anyone wants to use only the ESLint configuration that was formerly present in the "base" config without any Ember rules, it's better for them to manually specify the config in their own `.eslintrc.js` and avoid adding a dependency on eslint-plugin-ember.

Part of v11 release (https://github.com/ember-cli/eslint-plugin-ember/issues/1169).


Patch:
diff --git a/README.md b/README.md
index d1ec481a..78b0a890 100644
--- a/README.md
+++ b/README.md
@@ -46,8 +46,7 @@ module.exports = {
 
 |    | Name | Description |
 |:---|:-----|:------------|
-| | [base](./lib/config/base.js) | contains no rules settings, but the basic eslint configuration suitable for any ember project. You can use it to configure rules as you wish. |
-| ✅ | [recommended](./lib/recommended-rules.js) | extends the `base` configuration by enabling the recommended rules. |
+| ✅ | [recommended](./lib/recommended-rules.js) | enables the `recommended` rules |
 
 ## 🍟 Rules
 
diff --git a/lib/config/base.js b/lib/config/base.js
deleted file mode 100644
index 26d30096..00000000
--- a/lib/config/base.js
+++ /dev/null
@@ -1,15 +0,0 @@
-module.exports = {
-  root: true,
-
-  parserOptions: {
-    ecmaVersion: 2018,
-    sourceType: 'module',
-  },
-
-  env: {
-    browser: true,
-    es6: true,
-  },
-
-  plugins: ['ember'],
-};
diff --git a/lib/config/recommended.js b/lib/config/recommended.js
index c2c63ba4..f55cff55 100644
--- a/lib/config/recommended.js
+++ b/lib/config/recommended.js
@@ -1,6 +1,19 @@
 const rules = require('../recommended-rules');
 
 module.exports = {
-  extends: require.resolve('./base'),
+  root: true,
+
+  parserOptions: {
+    ecmaVersion: 2018,
+    sourceType: 'module',
+  },
+
+  env: {
+    browser: true,
+    es6: true,
+  },
+
+  plugins: ['ember'],
+
   rules,
 };


Test patch:
diff --git a/tests/config-setup.js b/tests/config-setup.js
index 8a5e584a..5f09d9ac 100644
--- a/tests/config-setup.js
+++ b/tests/config-setup.js
@@ -21,10 +21,7 @@ describe('config setup is correct', function () {
     const filePath = path.join(__dirname, '..', 'README.md');
     const file = readFileSync(filePath, 'utf8');
 
-    // We don't bother mentioning the `base` config in the README.
-    const CONFIG_NAMES_WITHOUT_BASE = CONFIG_NAMES.filter((configName) => configName !== 'base');
-
-    for (const configName of CONFIG_NAMES_WITHOUT_BASE) {
+    for (const configName of CONFIG_NAMES) {
       expect(file).toContain(configName);
     }
   });
diff --git a/tests/plugin-exports.js b/tests/plugin-exports.js
index a431b345..af06146c 100644
--- a/tests/plugin-exports.js
+++ b/tests/plugin-exports.js
@@ -2,7 +2,6 @@
 
 const plugin = require('../lib');
 const ember = require('../lib/utils/ember');
-const base = require('../lib/config/base');
 const recommended = require('../lib/config/recommended');
 
 describe('plugin exports', () => {
@@ -14,7 +13,7 @@ describe('plugin exports', () => {
 
   describe('configs', () => {
     it('has the right configurations', () => {
-      expect(plugin.configs).toStrictEqual({ base, recommended });
+      expect(plugin.configs).toStrictEqual({ recommended });
     });
   });
 });