Skip to content

Commit 7273675

Browse files
alecgibsonclaude
andcommitted
🔧 Migrate ESLint config to flat config for v10
At the moment, `npm run lint` fails outright under the ESLint v10 bump: v9 dropped the `--ignore-path` flag and v10 removed support for the `.eslintrc.*` format entirely, so ESLint can't even load its config. This change ports the config to the flat `eslint.config.js` format. The Google ruleset is a bare `rules` bag, so we can spread `google.rules` directly rather than pulling in `FlatCompat`. The ShareDB overrides and the ES6-option disables are carried over verbatim, `ecmaVersion` stays at 3, and the `coverage/` ignore (previously sourced from `.gitignore` via `--ignore-path`) moves into the config. The `lint` script drops the removed flag and becomes a plain `eslint .`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 1b97d5f commit 7273675

2 files changed

Lines changed: 20 additions & 11 deletions

File tree

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
var google = require('eslint-config-google');
2+
13
// The ESLint ecmaVersion argument is inconsistently used. Some rules will ignore it entirely, so if the rule has
24
// been set, it will still error even if it's not applicable to that version number. Since Google sets these
35
// rules, we have to turn them off ourselves.
@@ -37,14 +39,21 @@ var SHAREDB_RULES = {
3739
'valid-jsdoc': 'off'
3840
};
3941

40-
module.exports = {
41-
extends: 'google',
42-
parserOptions: {
43-
ecmaVersion: 3
42+
module.exports = [
43+
{
44+
ignores: ['node_modules/**', 'coverage/**']
4445
},
45-
rules: Object.assign(
46-
{},
47-
DISABLED_ES6_OPTIONS,
48-
SHAREDB_RULES
49-
)
50-
};
46+
{
47+
files: ['**/*.js'],
48+
languageOptions: {
49+
ecmaVersion: 3,
50+
sourceType: 'commonjs'
51+
},
52+
rules: Object.assign(
53+
{},
54+
google.rules,
55+
DISABLED_ES6_OPTIONS,
56+
SHAREDB_RULES
57+
)
58+
}
59+
];

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"nyc": "^18.0.0"
1717
},
1818
"scripts": {
19-
"lint": "./node_modules/.bin/eslint --ignore-path .gitignore '**/*.js'",
19+
"lint": "eslint .",
2020
"test": "mocha",
2121
"test-cover": "nyc --temp-dir=coverage -r text -r lcov npm test"
2222
},

0 commit comments

Comments
 (0)