Skip to content

Commit 7b386f6

Browse files
feat: migrate to flat config 🚀
BREAKING CHANGE: The ruleset has been migrated to ESLint flat config format and is therefore not compatible with ESLint v7 and using it with v8 requires a feature flag (`ESLINT_USE_FLAT_CONFIG=true`). Project configuration will also need to be completely reworked to use the new ruleset.
1 parent e044364 commit 7b386f6

37 files changed

+2184
-7109
lines changed
File renamed without changes.

.eslintrc.js

-22
This file was deleted.

.vscode/settings.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"**/.git": true,
55
"**/.DS_Store": true,
66
"**/*.log": true,
7-
"**/node_modules": true,
87
".eslintcache": true
98
},
109
// Custom Application window title ❤️
@@ -19,10 +18,10 @@
1918
"javascript.format.enable": false,
2019
"typescript.format.enable": false,
2120
// Enable ESLint and its auto-fixer
22-
"editor.formatOnSave": false,
2321
"editor.codeActionsOnSave": {
2422
"source.fixAll.eslint": "always"
2523
},
2624
"eslint.lintTask.enable": true,
2725
"eslint.lintTask.options": ".",
26+
"eslint.experimental.useFlatConfig": true,
2827
}

eslint.config.js

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import node from './packages/eslint-config-node/index.mjs'
2+
import optional from './packages/eslint-config-node/optional.mjs'
3+
import style from './packages/eslint-config-node/style.mjs'
4+
5+
/** @type {import("eslint").Linter.FlatConfig} */
6+
const common = {
7+
linterOptions: {
8+
reportUnusedDisableDirectives: true,
9+
},
10+
ignores: [
11+
'node_modules',
12+
'!.*.js',
13+
],
14+
}
15+
16+
/** @type {Array<import("eslint").Linter.FlatConfig>} */
17+
const configs = [
18+
common,
19+
node,
20+
optional,
21+
style,
22+
{ files: ['**/*.js'], languageOptions: { sourceType: 'commonjs' } },
23+
{ files: ['**/*.mjs', 'eslint.config.js'], languageOptions: { sourceType: 'module' } },
24+
]
25+
26+
export default configs

makefile

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
SHELL := sh
33
export PATH := bin/:node_modules/.bin/:$(PATH)
44
export NODE_OPTIONS := --trace-deprecation
5+
# Enable ESLint Flat Config support
6+
export ESLINT_USE_FLAT_CONFIG=true
57

68
# On CI servers, use the `npm ci` installer to avoid introducing changes to the package-lock.json
79
# On developer machines, prefer the generally more flexible `npm install`. 💪

0 commit comments

Comments
 (0)