-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
76 lines (75 loc) · 1.99 KB
/
Copy patheslint.config.js
File metadata and controls
76 lines (75 loc) · 1.99 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
const js = require('@eslint/js')
const nPlugin = require('eslint-plugin-n')
const promisePlugin = require('eslint-plugin-promise')
const importPlugin = require('eslint-plugin-import')
module.exports = [
js.configs.recommended,
// Ignore template and theme files - they're copied to generated projects as-is
{
ignores: ['templates/**/*', 'themes/**/*', 'utils/config-validator.js']
},
{
files: ['**/*.js'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'commonjs',
globals: {
console: 'readonly',
process: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
module: 'readonly',
require: 'readonly',
exports: 'readonly',
Buffer: 'readonly',
setTimeout: 'readonly',
setInterval: 'readonly',
clearTimeout: 'readonly',
clearInterval: 'readonly',
URL: 'readonly',
URLSearchParams: 'readonly'
}
},
plugins: {
n: nPlugin,
promise: promisePlugin,
import: importPlugin
},
rules: {
'no-console': 'off',
'prefer-const': 'error',
'no-var': 'error',
'no-unused-vars': ['warn', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_'
}],
'n/no-process-env': 'off',
'n/no-unpublished-import': 'off',
'promise/always-return': 'warn',
'promise/no-return-wrap': 'warn',
'import/no-unresolved': 'off'
}
},
{
files: ['tests/**/*.js', 'test/**/*.js', '**/*.test.js', '**/*.spec.js'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'commonjs',
globals: {
jest: 'readonly',
describe: 'readonly',
it: 'readonly',
test: 'readonly',
expect: 'readonly',
beforeEach: 'readonly',
afterEach: 'readonly',
beforeAll: 'readonly',
afterAll: 'readonly',
global: 'readonly',
spyOn: 'readonly',
fail: 'readonly'
}
}
}
]