-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy patheslint.config.mjs
37 lines (33 loc) · 985 Bytes
/
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
import pluginJest from 'eslint-plugin-jest';
import globals from 'globals';
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
// Nasty workaround for globals (https://github.com/sindresorhus/globals/issues/239)
// due to @babel/core still using an outdated version of the library
const GLOBALS_BROWSER_FIX = {
...globals.browser,
AudioWorkletGlobalScope: globals.browser['AudioWorkletGlobalScope '],
};
delete GLOBALS_BROWSER_FIX['AudioWorkletGlobalScope '];
export default tseslint.config(
{
ignores: ['coverage/', 'dist/', 'examples/', 'node_modules/', '**/*.cjs'],
},
eslint.configs.recommended,
tseslint.configs.recommended,
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
ecmaVersion: 2015,
sourceType: 'module',
globals: {
// ...globals.browser,
...GLOBALS_BROWSER_FIX,
},
},
plugins: {
'@typescript-eslint': tseslint.plugin,
jest: pluginJest,
},
},
);