Repository navigation
Expand file tree
/
Copy patheslint.config.js
More file actions
63 lines (62 loc) · 1.83 KB
/
Copy patheslint.config.js
File metadata and controls
63 lines (62 loc) · 1.83 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
const js = require('@eslint/js');
const prettier = require('eslint-config-prettier');
const globals = require('globals');
module.exports = [
{ ignores: ['node_modules/', 'test-results/', 'playwright-report/'] },
js.configs.recommended,
prettier,
{
files: ['script.js'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'script',
// Declared in texts.js, which loads first.
globals: {
...globals.browser,
COMMON_WORDS: 'readonly',
QUOTES: 'readonly',
CODE_SNIPPETS: 'readonly',
LESSON_HOME_WORDS: 'readonly',
WORD_LISTS: 'readonly',
},
},
rules: {
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
},
},
{
files: ['texts.js', 'wordlists.js', 'theme.js'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'script',
globals: { ...globals.browser },
},
// The constants are used by script.js.
rules: { 'no-unused-vars': 'off' },
},
{
files: ['sw.js'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'script',
globals: { ...globals.serviceworker },
},
},
{
files: ['tests/**/*.js', 'playwright.config.js', 'eslint.config.js'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'commonjs',
// Tests evaluate code in the browser as well as in Node.
globals: { ...globals.node, ...globals.browser },
},
},
{
files: ['scripts/**/*.mjs'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: { ...globals.node },
},
},
];