forked from Barata-Ribeiro/vite-vanilla-js-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
47 lines (46 loc) · 1.34 KB
/
eslint.config.js
File metadata and controls
47 lines (46 loc) · 1.34 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
import { defineConfig, globalIgnores } from 'eslint/config';
import js from '@eslint/js';
import globals from 'globals';
import importPlugin from 'eslint-plugin-import';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
export default defineConfig([
globalIgnores(['dist/**/*', 'build/**/*', 'node_modules/*']),
js.configs.recommended,
importPlugin.flatConfigs.recommended,
{
files: ['**/*.{js,mjs,cjs,ts,mts,cts}'],
plugins: { js },
extends: ['js/recommended'],
settings: {
'import/core-modules': ['eslint/config'],
'import/resolver': {
node: {
extensions: ['.js', '.mjs', '.cjs', '.ts', '.mts', '.cts'],
moduleDirectory: ['node_modules', 'src/'],
paths: ['src'],
},
},
},
languageOptions: {
globals: { ...globals.browser },
ecmaVersion: 'latest',
sourceType: 'module',
},
rules: {
indent: 'off',
'no-unused-vars': 'off',
'no-console': ['warn', { allow: ['warn', 'error'] }],
'prettier/prettier': 'error',
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
'import/unambiguous': 'off',
},
},
{
files: ['**/*.cjs'],
languageOptions: {
globals: globals.node,
sourceType: 'script',
},
},
eslintPluginPrettierRecommended,
]);