-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
46 lines (44 loc) · 1.23 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
const fs = require('fs');
const foldersUnderSrc = fs
.readdirSync('src', { withFileTypes: true })
.filter((dirent) => dirent.isDirectory())
.map((dirent) => dirent.name);
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
},
plugins: ['@typescript-eslint', 'jest', 'simple-import-sort'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
],
rules: {
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'simple-import-sort/imports': [
'error',
{
groups: [
// Packages. `react` related packages come first.
// Things that start with a letter (or digit or underscore), or `@` followed by a letter.
['^@?\\w'],
// Absolute imports and Relative imports.
[`^(${foldersUnderSrc.join('|')})(/.*|$)`, '^\\.'],
],
},
],
'simple-import-sort/exports': 'error',
quotes: [
'error',
'single',
{ avoidEscape: true, allowTemplateLiterals: false },
],
},
env: {
node: true,
'jest/globals': true,
},
ignorePatterns: ['.eslintrc.js'],
};