forked from AMDmi3/opening_hours.js
-
Notifications
You must be signed in to change notification settings - Fork 130
Expand file tree
/
Copy patheslint.config.mjs
More file actions
38 lines (37 loc) · 1.15 KB
/
eslint.config.mjs
File metadata and controls
38 lines (37 loc) · 1.15 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
import { defineConfig, globalIgnores } from 'eslint/config'
import globals from 'globals'
import js from '@eslint/js'
import markdown from '@eslint/markdown'
import stylistic from '@stylistic/eslint-plugin'
import tseslint from 'typescript-eslint'
export default defineConfig([
globalIgnores(['build/*', 'submodules/*', '**/yohours_model.js', 'src/holidays/generated-openholidays.js']),
{
files: ['**/*.js', '**/*.mjs'],
extends: [js.configs.recommended],
plugins: { '@stylistic': stylistic },
languageOptions: {
ecmaVersion: 'latest',
globals: {
...globals.browser,
...globals.node,
},
sourceType: 'module',
},
rules: {
'@stylistic/quotes': [ 'error', 'single' ],
'@stylistic/no-trailing-spaces': 'error',
'prefer-const': 'error',
'no-var': 'error'
},
},
{ files: ['**/*.md'], plugins: { markdown }, language: 'markdown/gfm', extends: ['markdown/recommended'] },
{
files: ['**/*.ts'],
extends: [tseslint.configs.recommended],
rules: {
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
},
},
])