Skip to content

Commit 91f30f4

Browse files
committed
chore: migrate ESLint config
1 parent 4bfb9f6 commit 91f30f4

File tree

3 files changed

+47
-24
lines changed

3 files changed

+47
-24
lines changed

.eslintrc.cjs

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

eslint.config.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import js from '@eslint/js';
2+
import prettierConfig from 'eslint-plugin-prettier/recommended';
3+
import jestPlugin from 'eslint-plugin-jest';
4+
import globals from 'globals';
5+
6+
export default [
7+
{
8+
files: ['**/*.js'],
9+
},
10+
{
11+
// Ignore patterns
12+
ignores: ['coverage/**'],
13+
},
14+
js.configs.recommended,
15+
prettierConfig,
16+
{
17+
// Base settings
18+
languageOptions: {
19+
ecmaVersion: 'latest',
20+
sourceType: 'module',
21+
globals: {
22+
...globals.node,
23+
...globals.es6,
24+
},
25+
},
26+
rules: {
27+
'prettier/prettier': 'warn',
28+
},
29+
},
30+
{
31+
// Jest settings for test files
32+
files: ['**/*.test.js'],
33+
languageOptions: {
34+
globals: {
35+
...globals.jest,
36+
},
37+
},
38+
plugins: {
39+
jest: jestPlugin,
40+
},
41+
rules: {
42+
...jestPlugin.configs.recommended.rules,
43+
...jestPlugin.configs.style.rules,
44+
},
45+
},
46+
];

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"license": "MIT",
1010
"type": "module",
1111
"scripts": {
12-
"lint:eslint": "eslint . --ext .js",
12+
"lint:eslint": "eslint .",
1313
"lint:prettier": "prettier ./**/*.{json,md,yml} --check",
1414
"lint": "npm run lint:eslint && npm run lint:prettier",
1515
"lint:fix": "npm run lint:eslint -- --fix && npm run lint:prettier -- --write",

0 commit comments

Comments
 (0)