-
Notifications
You must be signed in to change notification settings - Fork 57
/
eslint.config.js
60 lines (58 loc) · 1.84 KB
/
eslint.config.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import { fixupConfigRules } from '@eslint/compat';
import { FlatCompat } from '@eslint/eslintrc';
import globals from 'globals';
import jest from 'eslint-plugin-jest';
import js from '@eslint/js';
import prettier from 'eslint-config-prettier';
import ts from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import imprt from 'eslint-plugin-import'; // 'import' is ambiguous & prettier has trouble
const flatCompat = new FlatCompat();
export default [
{
...js.configs.recommended,
files: ['src/**', 'test/**'],
},
{
...fixupConfigRules(flatCompat.extends('airbnb-base')),
files: ['src/**', 'test/**'],
},
prettier,
{
languageOptions: {
globals: {
...globals.jest,
...globals.node,
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parser: tsParser,
parserOptions: {
project: './tsconfig.json',
requireConfigFile: false,
ecmaVersion: 2022,
ecmaFeatures: { modules: true },
},
},
files: ['src/**', 'test/**'],
plugins: { jest, '@typescript-eslint': ts, import: imprt, ts },
rules: {
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
'no-console': 'error',
'import/first': 'error',
'linebreak-style': 0, // disable linter linebreak rule, to allow for both unix and windows developement
'import/no-unresolved': 'off', // Whatever IDE will pass an error if if the module is not found, so no reason for this..
'import/extensions': 'off', // That includes the production build.. We use linter for code checking / clean code optimization..
'no-use-before-define': 'off',
},
ignores: [
'api/*',
'build/*',
'coverage/*',
'dist/*',
'node_modules/*',
'script/*',
'src/types.ts',
],
},
];