-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
52 lines (48 loc) · 1.36 KB
/
Copy patheslint.config.js
File metadata and controls
52 lines (48 loc) · 1.36 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
/**
* @file ESLint configuration file
* @author Zachary K. Watkins
* @description This file's configuration should mirror the `.eslintrc.js`
* configuration. Both files are needed until the `.eslintrc.js` can be safely
* removed.
*/
'use strict'
const { defineFlatConfig } = require('eslint-define-config')
const globals = require('globals')
const js = require('@eslint/js')
const jsonc = require('eslint-plugin-jsonc')
const ignores = ['node_modules/', 'build/']
const MyConfig = {
files: ['**/*.js', '*.js'],
ignores,
languageOptions: {
parserOptions: {
sourceType: 'module',
ecmaVersion: 2018,
},
globals: {
...globals.serviceworker,
...globals.browser,
...globals.node,
...globals.es2018,
...globals.commonjs,
},
},
rules: {
...js.configs.recommended.rules,
indent: ['error', 4],
quotes: ['error', 'single'],
semi: ['error', 'never'],
'prefer-const': 'error',
'comma-dangle': ['error', 'always-multiline'],
},
}
const MyJsonConfig = {
files: ['**/*.json', '*.json'],
ignores,
plugins: { jsonc },
languageOptions: {
parser: jsonc,
},
rules: jsonc.configs['recommended-with-jsonc'].rules,
}
module.exports = defineFlatConfig([{ ignores }, MyJsonConfig, MyConfig])