forked from GoogleChrome/chrome-extensions-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
73 lines (70 loc) · 1.74 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
61
62
63
64
65
66
67
68
69
70
71
72
73
const js = require('@eslint/js');
const globals = require('globals');
const prettier = require('eslint-plugin-prettier');
const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended');
const jest = require('eslint-plugin-jest');
module.exports = [
js.configs.recommended,
eslintPluginPrettierRecommended,
{
plugins: {
prettier
},
rules: {
'prettier/prettier': ['error'],
'no-var': ['error'],
'no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_'
}
]
},
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.browser,
...globals.webextensions,
...globals.es2021,
...globals.jquery,
...globals.serviceworker
}
}
},
{
files: [
'functional-samples/tutorial.puppeteer/**/*',
'functional-samples/tutorial.terminate-sw/**/*'
],
plugins: { jest },
rules: {
...jest.configs['flat/recommended'].rules
},
languageOptions: {
globals: {
...globals.jest
}
},
settings: {
jest: {
version: '29.7.0'
}
}
},
{
// Ignores must be in a separate block to apply globally:
// https://eslint.org/docs/latest/use/configure/configuration-files#globally-ignoring-files-with-ignores
ignores: [
'eslint.config.js',
'.repo/**/*',
'_archive/**/*',
'**/third-party/**',
'**/node_modules/**/*',
// These are autogenerated files that we shouldn't lint
'functional-samples/cookbook.wasm-helloworld-print/wasm/pkg/**/*',
'functional-samples/cookbook.wasm-helloworld-print-nomodule/wasm/pkg/**/*'
]
}
];