-
Notifications
You must be signed in to change notification settings - Fork 135
Expand file tree
/
Copy patheslint.config.mjs
More file actions
109 lines (102 loc) · 2.74 KB
/
Copy patheslint.config.mjs
File metadata and controls
109 lines (102 loc) · 2.74 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
//
// Copyright (c) Microsoft.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
import globals from 'globals';
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import pluginSecurity from 'eslint-plugin-security';
import pluginN from 'eslint-plugin-n';
import tsParser from '@typescript-eslint/parser';
import js from '@eslint/js';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
export default [
pluginSecurity.configs.recommended,
{
rules: {
// These are so common in Node codebases it does not provide sufficient value to warn
'security/detect-object-injection': 'off',
'security/detect-non-literal-fs-filename': 'off',
},
},
{
ignores: [
'.github/build/*.cjs',
'.github/build/*.js',
'default-assets-package/thirdparty/**/*.js',
'dist/**/*.js',
'dist/**/*.cjs',
'dist/**/*.mjs',
'dist/**/*.d.ts',
'.environment/validate.js',
'.ossdev/build/*.cjs',
'**/frontend/',
'**/vendor/**/*',
'**/vendor.nocommit/**/*',
'views/js/**/*',
'.eslint.config.mjs', // this file
],
},
js.configs.recommended,
eslintPluginPrettierRecommended,
{
// Rules added in eslint:recommended for ESLint v10 - disable for now
rules: {
'no-useless-assignment': 'off',
'preserve-caught-error': 'off',
'no-unassigned-vars': 'off',
},
},
{
languageOptions: {
ecmaVersion: 2021,
sourceType: 'module',
},
},
{
files: ['**/*.js'],
languageOptions: {
globals: {
...globals.node,
},
},
},
...typescriptEslint.configs['flat/recommended'].map((config) => ({
...config,
files: ['**/*.ts'],
})),
...[pluginN.configs['flat/recommended']].map((config) => ({
...config,
files: ['**/*.ts'],
})),
{
files: ['**/*.ts'],
languageOptions: {
parser: tsParser,
},
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-var-requires': 'off',
'n/no-missing-import': 'off',
'n/no-process-exit': 'off',
'n/shebang': 'off',
'no-case-declarations': 'off',
'no-empty': 'off',
'no-ex-assign': 'off',
'no-inner-declarations': 'off',
'no-useless-catch': 'off',
'prefer-const': [
'error',
{
destructuring: 'all',
},
],
'prefer-rest-params': 'off',
'prefer-spread': 'off',
},
},
];