-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy patheslint.config.mjs
More file actions
57 lines (56 loc) · 1.5 KB
/
Copy patheslint.config.mjs
File metadata and controls
57 lines (56 loc) · 1.5 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
import js from '@eslint/js';
import { defineConfig, globalIgnores } from 'eslint/config';
import configPrettier from 'eslint-config-prettier/flat';
import eslintPluginPrettier from 'eslint-plugin-prettier';
import globals from 'globals';
import tseslint from 'typescript-eslint';
export default defineConfig(
globalIgnores([
'**/node_modules/**',
'**/dist/**',
'**/comparison/**',
'**/bench/**',
'**/publicsuffix/**',
'**/bin/**/*.js',
'eslint.config.mjs', // self: no typings for eslint/config deps in default project
]),
js.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: {
allowDefaultProject: [
'*.cjs',
'*.mjs',
'packages/*/rollup.config.mjs',
],
},
tsconfigRootDir: import.meta.dirname,
},
globals: {
...globals.browser,
...globals.node,
},
},
rules: {
// Many array/index non-null assertions in trie and packed-hashes; keep off for now
'@typescript-eslint/no-non-null-assertion': 'off',
// Allow numbers in template expressions (no explicit String() needed)
'@typescript-eslint/restrict-template-expressions': [
'error',
{ allowNumber: true },
],
},
},
{
plugins: {
prettier: eslintPluginPrettier,
},
rules: {
'prettier/prettier': 'error',
},
},
configPrettier,
);