Skip to content

Commit 9b305e9

Browse files
committed
lint: migrated to flat config
1 parent a995211 commit 9b305e9

2 files changed

Lines changed: 47 additions & 28 deletions

File tree

.eslintrc.json

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

eslint.config.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
'use strict'
2+
3+
import stylistic from '@stylistic/eslint-plugin'
4+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
5+
import jest from 'eslint-plugin-jest'
6+
import love from 'eslint-config-love'
7+
8+
export default [
9+
{
10+
ignores: ['dist', '**/*.js']
11+
},
12+
// Stylistic
13+
{
14+
plugins: {
15+
'@stylistic': stylistic
16+
},
17+
rules: {
18+
'@stylistic/indent': ['error', 4],
19+
'@stylistic/quotes': ['error', 'single', { avoidEscape: true, allowTemplateLiterals: true }],
20+
'@stylistic/space-before-function-paren': 'off',
21+
'@stylistic/no-unmodified-loop-condition': 'off'
22+
}
23+
},
24+
// eslint-config-love
25+
{
26+
...love
27+
},
28+
// Jest
29+
{
30+
files: ['test/**/*.test.ts', 'tests/**/*.test.ts', 'test/**/*.spec.ts', 'tests/**/*.spec.ts'],
31+
...jest.configs['flat/recommended'],
32+
rules: {
33+
...jest.configs['flat/recommended'].rules,
34+
...jest.configs['flat/style'].rules
35+
}
36+
},
37+
// Prettier
38+
eslintPluginPrettierRecommended,
39+
// Custom
40+
{
41+
rules:{
42+
'max-nested-callbacks': 'off',
43+
'max-lines': 'off'
44+
},
45+
files: ['tests/**.test.ts']
46+
}
47+
]

0 commit comments

Comments
 (0)