-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheslint.config.js
50 lines (48 loc) · 1.47 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
/**
* ESlint Flat Config.
*
* https://www.raulmelo.me/en/blog/migration-eslint-to-flat-config
*/
import globals from 'globals';
import js from '@eslint/js';
import wc from 'eslint-plugin-wc';
import lit from 'eslint-plugin-lit';
import eslintConfigPrettier from 'eslint-config-prettier';
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
/** @type {import('eslint').Linter.FlatConfig[]} */
export default [
{
// Global ignores
ignores: ['dist/**', 'node_modules/**'],
// Global languageOptions
languageOptions: {
// https://eslint.org/docs/latest/use/configure/migration-guide#configuring-language-options
globals: globals.mocha,
},
},
{
files: ['src/components/**/*.js', 'src/components/**/*.ts'],
languageOptions: {
globals: globals.browser,
parser: tsParser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
},
plugins: {
typescriptEslint,
// https://github.com/open-wc/open-wc/blob/master/packages/eslint-config/index.js
// https://github.com/43081j/eslint-plugin-wc/blob/master/src/configs/best-practice.ts
wc,
lit,
},
rules: {
...js.configs.recommended.rules,
'no-unused-vars': ['error', { varsIgnorePattern: 'HTMLElementTagNameMap' }],
},
},
// https://github.com/prettier/eslint-config-prettier#eslintconfigjs-flat-config-plugin-caveat
eslintConfigPrettier,
];