-
-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy patheslint.config.js
More file actions
36 lines (35 loc) · 998 Bytes
/
eslint.config.js
File metadata and controls
36 lines (35 loc) · 998 Bytes
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
import eslint from '@eslint/js';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import globals from 'globals';
import { readFileSync } from 'node:fs';
import tseslint from 'typescript-eslint';
export default tseslint.config(
eslint.configs.recommended,
eslintPluginPrettierRecommended,
// https://typescript-eslint.io/users/configs#recommended-configurations
tseslint.configs.recommended,
// Apply type-checking only to TypeScript files
...tseslint.configs.recommendedTypeChecked.map((sharedConfig) => ({
...sharedConfig,
files: ['**/*.ts'],
})),
{
languageOptions: {
parserOptions: {
project: ['./tsconfig.eslint.json'],
},
},
rules: {
'prettier/prettier': 2, // Means error
},
},
{
files: ['lint.js', 'cli.js', 'scripts/**/*.js', 'test/**/*.js'],
languageOptions: {
globals: globals.node,
},
},
{
ignores: readFileSync('./.gitignore', 'utf8').split('\n'),
},
);