-
Notifications
You must be signed in to change notification settings - Fork 1
/
eslint.config.mjs
131 lines (123 loc) · 3.15 KB
/
eslint.config.mjs
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/**
* @license Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @author [email protected] (Markus Bordihn)
* @file Defines and creates the Chrome dev tools panel.
*/
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import globals from 'globals';
import tsParser from '@typescript-eslint/parser';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});
export default [
{
ignores: [
'**/build',
'**/coverage',
'**/dist',
'**/global.d.ts',
'**/node_modules',
],
},
...compat.extends(
'eslint:recommended',
'plugin:jsdoc/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'plugin:compat/recommended',
),
{
plugins: {
'@typescript-eslint': typescriptEslint,
},
languageOptions: {
globals: {
...globals.browser,
...Object.fromEntries(
Object.entries(globals.serviceworker).map(([key]) => [key, 'off']),
),
console: true,
DEVMODE: false,
VERSION: false,
ViewabilityInsights: true,
chrome: true,
globalThis: false,
googletag: true,
MessageEvent: true,
serviceWorkerOption: true,
window: true,
},
parser: tsParser,
ecmaVersion: 2024,
sourceType: 'module',
},
settings: {},
rules: {
'no-unused-vars': [
2,
{
args: 'after-used',
argsIgnorePattern: '^opt_',
varsIgnorePattern: '_unused$',
},
],
'no-console': 'off',
camelcase: [
0,
{
properties: 'never',
},
],
'new-cap': [
2,
{
newIsCapExceptions: [],
},
],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'jsdoc/check-values': 'off',
'jsdoc/lines-before-block': 'off',
},
},
{
files: ['**/*_test.js'],
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.jasmine,
...globals.serviceworker,
},
},
},
{
files: ['build/**/*.js'],
rules: {
'@typescript-eslint/camelcase': 'off',
},
},
];