-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathflat.js
More file actions
69 lines (68 loc) · 2.15 KB
/
flat.js
File metadata and controls
69 lines (68 loc) · 2.15 KB
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
61
62
63
64
65
66
67
68
69
// @ts-check
import eslintJs from '@eslint/js';
// @ts-expect-error: TODO: No typings yet
import comments from '@eslint-community/eslint-plugin-eslint-comments/configs';
import stylistic from '@stylistic/eslint-plugin';
import eslintConfigPrettier from 'eslint-config-prettier';
import { importX } from 'eslint-plugin-import-x';
import optimizeRegEx from 'eslint-plugin-optimize-regex';
// @ts-expect-error: TODO: No typings yet
import promise from 'eslint-plugin-promise';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import airbnbRules from './airbnb-rules.json' with { type: 'json' };
import cjsFiles from './overrides/cjs-files.js';
import stylisticRules from './overrides/stylistic.js';
import tsFiles from './overrides/ts-files.js';
import noSecrets from './plugins/no-secrets.mjs';
import rules from './rules.json' with { type: 'json' };
import settings from './settings.json' with { type: 'json' };
/** @type {import('eslint').Linter.Config<import('eslint').Linter.RulesRecord>[]} */
export default [
eslintJs.configs.recommended,
...tseslint.configs.recommended,
comments.recommended,
promise.configs['flat/recommended'],
stylistic.configs.recommended,
eslintConfigPrettier,
importX.flatConfigs.recommended,
importX.flatConfigs.typescript,
...noSecrets,
// @ts-expect-error: TODO: No typings match
optimizeRegEx.configs.recommended,
{
name: 'eslint-config-airlight-base',
plugins: {
'@typescript-eslint': tseslint.plugin
},
languageOptions: {
ecmaVersion: 2020,
sourceType: 'module',
parser: tseslint.parser,
globals: {
...globals.es2015,
...globals.es2020
}
},
rules: {
...airbnbRules,
...rules,
...stylisticRules,
'@stylistic/comma-dangle': ['error', 'never'],
'@stylistic/comma-spacing': ['error', { before: false, after: true }],
'import-x/no-unresolved': 'error'
},
settings: {
...settings,
'import-x/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx']
},
'import-x/resolver': {
typescript: true,
node: true
}
}
},
...tsFiles,
...cjsFiles
];