forked from Captsi/MMM-OneCallWeather
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy patheslint.config.mjs
More file actions
92 lines (91 loc) · 3.11 KB
/
eslint.config.mjs
File metadata and controls
92 lines (91 loc) · 3.11 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
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
import css from '@eslint/css'
import { defineConfig } from 'eslint/config'
import globals from 'globals'
import { flatConfigs as importX } from 'eslint-plugin-import-x'
import js from '@eslint/js'
import markdown from '@eslint/markdown'
import stylistic from '@stylistic/eslint-plugin'
export default defineConfig([
{ files: ['**/*.css'], languageOptions: { tolerant: true }, plugins: { css }, language: 'css/css', extends: ['css/recommended'], rules: { 'css/use-baseline': ['error', { available: 'newly' }] } },
{
files: ['**/*.js'],
languageOptions: {
ecmaVersion: 'latest',
globals: {
...globals.browser,
...globals.node,
Log: 'readonly',
Module: 'readonly',
WeatherObject: 'readonly',
config: 'readonly',
},
},
extends: [importX.recommended, js.configs.all, stylistic.configs.recommended],
rules: {
'@stylistic/array-element-newline': ['error', 'consistent'],
'@stylistic/dot-location': ['error', 'property'],
'@stylistic/function-call-argument-newline': ['error', 'consistent'],
'@stylistic/indent': ['error', 2],
'@stylistic/lines-around-comment': 'off',
'@stylistic/no-multi-spaces': ['error', { ignoreEOLComments: true }],
'@stylistic/padded-blocks': ['error', 'never'],
'@stylistic/quote-props': ['error', 'as-needed'],
'capitalized-comments': 'off',
'complexity': 'off',
'id-length': 'off',
'init-declarations': 'off',
'line-comment-position': 'off',
'max-lines': ['warn', 1000],
'max-lines-per-function': ['warn', 500],
'max-params': ['warn', 4],
'max-statements': ['warn', 300],
'multiline-comment-style': 'off',
'no-inline-comments': 'off',
'no-magic-numbers': 'off',
'no-ternary': 'off',
'one-var': 'off',
'sort-keys': 'off',
},
},
{
files: ['**/*.mjs'],
languageOptions: {
ecmaVersion: 'latest',
globals: {
...globals.node,
},
sourceType: 'module',
},
extends: [importX.recommended, js.configs.all, stylistic.configs.recommended],
rules: {
'@stylistic/array-element-newline': ['error', 'consistent'],
'@stylistic/indent': ['error', 2],
'@stylistic/object-property-newline': ['error', { allowAllPropertiesOnSameLine: true }],
'import-x/no-unresolved': ['error', { ignore: ['eslint/config'] }],
'no-magic-numbers': 'off',
'sort-keys': 'off',
},
},
{
files: ['tests/**/*.test.mjs'],
languageOptions: {
ecmaVersion: 'latest',
globals: {
...globals.node,
},
sourceType: 'module',
},
extends: [importX.recommended, stylistic.configs.recommended],
rules: {
'@stylistic/indent': ['error', 2],
'init-declarations': 'off',
'max-lines-per-function': 'off',
'max-statements': 'off',
'no-inline-comments': 'off',
'no-magic-numbers': 'off',
'no-undefined': 'off',
},
},
{ files: ['demo.config.js'], rules: { 'prefer-const': 'off' } },
{ files: ['**/*.md'], plugins: { markdown }, extends: ['markdown/recommended'], language: 'markdown/gfm' },
])