chore: set up eslint
This commit is contained in:
parent
5bc7712731
commit
23af739ee4
4 changed files with 76 additions and 18 deletions
11
.vscode/settings.json
vendored
11
.vscode/settings.json
vendored
|
@ -3,6 +3,13 @@
|
|||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll": "explicit"
|
||||
},
|
||||
"cSpell.words": ["Astro"],
|
||||
"prettier.documentSelectors": ["**/*.astro"]
|
||||
"prettier.documentSelectors": ["**/*.astro"],
|
||||
"prettier.configPath": "",
|
||||
"prettier.ignorePath": "",
|
||||
"[typescript]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
"[javascript]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,19 +1,41 @@
|
|||
import globals from 'globals'
|
||||
import eslintPluginAstro from 'eslint-plugin-astro'
|
||||
import jsPlugin from '@eslint/js';
|
||||
import jsPlugin from '@eslint/js'
|
||||
import tseslint from 'typescript-eslint'
|
||||
import astroParser from 'astro-eslint-parser'
|
||||
|
||||
export default [
|
||||
{
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.browser,
|
||||
...globals.node,
|
||||
},
|
||||
},
|
||||
},
|
||||
// add more generic rule sets here, such as:
|
||||
jsPlugin.configs.recommended,
|
||||
...tseslint.configs.recommended,
|
||||
...eslintPluginAstro.configs['recommended'],
|
||||
...eslintPluginAstro.configs['jsx-a11y-recommended'],
|
||||
{
|
||||
ignores: [
|
||||
'dist/*',
|
||||
'.output/*',
|
||||
'.nitro/*',
|
||||
'node-modules*',
|
||||
'.astro/*',
|
||||
'site/*',
|
||||
'templates/*',
|
||||
'**/node_modules/*',
|
||||
'**/env.d.ts',
|
||||
],
|
||||
},
|
||||
{
|
||||
files: ['**/*.astro'],
|
||||
languageOptions: {
|
||||
parser: astroParser,
|
||||
parserOptions: {
|
||||
parser: tseslint.parser,
|
||||
},
|
||||
},
|
||||
},
|
||||
]
|
||||
|
|
|
@ -37,15 +37,18 @@
|
|||
"@types/node": "^22.10.2",
|
||||
"@typescript-eslint/eslint-plugin": "^8.18.2",
|
||||
"@typescript-eslint/parser": "^8.18.2",
|
||||
"astro-eslint-parser": "^1.1.0",
|
||||
"eslint": "^9.17.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-astro": "^1.3.1",
|
||||
"eslint-plugin-jsx-a11y": "^6.10.2",
|
||||
"eslint-plugin-prettier": "^5.2.1",
|
||||
"globals": "^15.14.0",
|
||||
"husky": "^9.1.7",
|
||||
"prettier": "^3.4.2",
|
||||
"prettier-plugin-astro": "^0.14.1",
|
||||
"typescript": "^5.7.2"
|
||||
"typescript": "^5.7.2",
|
||||
"typescript-eslint": "^8.18.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"astro": "^5"
|
||||
|
|
|
@ -27,6 +27,9 @@ importers:
|
|||
'@typescript-eslint/parser':
|
||||
specifier: ^8.18.2
|
||||
version: 8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2)
|
||||
astro-eslint-parser:
|
||||
specifier: ^1.1.0
|
||||
version: 1.1.0(typescript@5.7.2)
|
||||
eslint:
|
||||
specifier: ^9.17.0
|
||||
version: 9.17.0(jiti@2.4.2)
|
||||
|
@ -42,6 +45,9 @@ importers:
|
|||
eslint-plugin-prettier:
|
||||
specifier: ^5.2.1
|
||||
version: 5.2.1(@types/eslint@9.6.1)(eslint-config-prettier@9.1.0(eslint@9.17.0(jiti@2.4.2)))(eslint@9.17.0(jiti@2.4.2))(prettier@3.4.2)
|
||||
globals:
|
||||
specifier: ^15.14.0
|
||||
version: 15.14.0
|
||||
husky:
|
||||
specifier: ^9.1.7
|
||||
version: 9.1.7
|
||||
|
@ -54,6 +60,9 @@ importers:
|
|||
typescript:
|
||||
specifier: ^5.7.2
|
||||
version: 5.7.2
|
||||
typescript-eslint:
|
||||
specifier: ^8.18.2
|
||||
version: 8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2)
|
||||
|
||||
packages:
|
||||
|
||||
|
@ -2438,6 +2447,13 @@ packages:
|
|||
resolution: {integrity: sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
typescript-eslint@8.18.2:
|
||||
resolution: {integrity: sha512-KuXezG6jHkvC3MvizeXgupZzaG5wjhU3yE8E7e6viOvAvD9xAWYp8/vy0WULTGe9DYDWcQu7aW03YIV3mSitrQ==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
typescript: '>=4.8.4 <5.8.0'
|
||||
|
||||
typescript@5.7.2:
|
||||
resolution: {integrity: sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==}
|
||||
engines: {node: '>=14.17'}
|
||||
|
@ -5516,6 +5532,16 @@ snapshots:
|
|||
possible-typed-array-names: 1.0.0
|
||||
reflect.getprototypeof: 1.0.9
|
||||
|
||||
typescript-eslint@8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2):
|
||||
dependencies:
|
||||
'@typescript-eslint/eslint-plugin': 8.18.2(@typescript-eslint/parser@8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2))(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2)
|
||||
'@typescript-eslint/parser': 8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2)
|
||||
'@typescript-eslint/utils': 8.18.2(eslint@9.17.0(jiti@2.4.2))(typescript@5.7.2)
|
||||
eslint: 9.17.0(jiti@2.4.2)
|
||||
typescript: 5.7.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
typescript@5.7.2: {}
|
||||
|
||||
ufo@1.5.4: {}
|
||||
|
|
Loading…
Reference in a new issue