-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy patheslint.config.js
73 lines (72 loc) · 1.92 KB
/
eslint.config.js
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
import pluginJs from '@eslint/js'
import parserTs from '@typescript-eslint/parser'
import parserAstro from 'astro-eslint-parser'
import eslintConfigPrettier from 'eslint-config-prettier'
import eslintPluginAstro from 'eslint-plugin-astro'
import globals from 'globals'
import neostandard, { plugins } from 'neostandard'
/** @type {import('eslint').Linter.Config[]} */
export default [
{ ignores: ['.astro/*', 'dist/*', 'src/components/PostHog.astro'] },
{ files: ['**/*.{js,mjs,cjs,ts}'] },
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
pluginJs.configs.recommended,
...neostandard({
noJsx: true,
noStyle: true
}),
{
plugins: {
'@stylistic': plugins['@stylistic']
},
rules: {
'@stylistic/comma-dangle': [
'error',
{
arrays: 'never',
objects: 'never',
imports: 'never',
exports: 'never',
functions: 'never',
importAttributes: 'never',
dynamicImports: 'never'
}
],
'@stylistic/no-multi-spaces': [
'error',
{
ignoreEOLComments: false
}
]
}
},
...plugins['typescript-eslint'].config({
extends: [...plugins['typescript-eslint'].configs.recommended],
rules: {
'@typescript-eslint/space-before-function-paren': ['error', 'never'],
'@typescript-eslint/triple-slash-reference': 'off'
}
}),
{
files: ['src/**/*.astro'],
languageOptions: {
globals: eslintPluginAstro.environments.astro.globals,
parser: parserAstro,
parserOptions: {
parser: parserTs,
extraFileExtensions: ['.astro']
}
},
rules: {
'astro/jsx-a11y/anchor-is-valid': 'warn'
}
},
...eslintPluginAstro.configs['jsx-a11y-recommended'],
...eslintPluginAstro.configs.recommended,
{
rules: {
'@typescript-eslint/ban-ts-comment': 'warn'
}
},
eslintConfigPrettier
]