Skip to content

Commit d37b9e2

Browse files
committed
Add ESLint 10 support
1 parent f626e82 commit d37b9e2

9 files changed

Lines changed: 2783 additions & 3928 deletions

File tree

.eslintrc.json

Lines changed: 0 additions & 27 deletions
This file was deleted.

.husky/pre-commit

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
npx lint-staged

.husky/pre-push

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
npm run test

eslint.config.mjs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { defineConfig } from 'eslint/config';
2+
import eslintPlugin from 'eslint-plugin-eslint-plugin';
3+
import globals from 'globals';
4+
import js from '@eslint/js';
5+
6+
export default defineConfig([
7+
js.configs.recommended,
8+
{
9+
plugins: {
10+
'eslint-plugin': eslintPlugin,
11+
},
12+
13+
languageOptions: {
14+
globals: {
15+
...globals.commonjs,
16+
...globals.node,
17+
},
18+
19+
ecmaVersion: 11,
20+
sourceType: 'module',
21+
},
22+
23+
rules: {
24+
quotes: ['error', 'single'],
25+
26+
'no-nested-ternary': 'off',
27+
},
28+
},
29+
]);

lib/enforce.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ module.exports = {
303303
if (!blankLinesChecked) {
304304
const singleLine = importLineCount === 1;
305305
if (singleLine) {
306-
const line = context.getSourceCode().getText(node);
306+
const line = context.sourceCode.getText(node);
307307
if (line.length > maxLineLength) {
308308
const canBeSplit = specifiers.length > 2
309309
|| specifiers.some((specifier) => !nonSplittableImportTypes.has(specifier.type));

0 commit comments

Comments
 (0)