@@ -4,51 +4,38 @@ import astroPlugin from "eslint-plugin-astro";
44import * as typescriptESLintParserForExtraFiles from "typescript-eslint-parser-for-extra-files" ;
55
66import { __dirname } from "../lib/dir" ;
7- import { astroFiles , tsFiles } from "../utils/files" ;
7+ import { prepareForExtend } from "../utils/eslint" ;
8+ import { astroFiles } from "../utils/files" ;
89import { jsConfig } from "./js" ;
910import { stylisticConfig } from "./stylistic" ;
1011import { tsConfig } from "./typescript" ;
1112
12- export const astroConfig = defineConfig (
13- {
14- files : [ tsFiles ] ,
15- languageOptions : {
16- // @ts -expect-error type mismatch, but works
13+ export const astroConfig = defineConfig ( {
14+ extends : prepareForExtend (
15+ jsConfig ,
16+ stylisticConfig ,
17+ tsConfig ( { extraFiles : true } ) ,
18+ astroPlugin . configs . recommended ,
19+ astroPlugin . configs [ "jsx-a11y-strict" ] ,
20+ ) ,
21+ files : [ astroFiles ] ,
22+ languageOptions : {
23+ parser : astroESLintParser ,
24+ parserOptions : {
1725 parser : typescriptESLintParserForExtraFiles ,
18- parserOptions : {
19- project : true ,
20- projectService : false ,
21- tsconfigRootDir : __dirname ,
22- } ,
26+ project : true ,
27+ projectService : false ,
28+ tsconfigRootDir : __dirname ,
2329 } ,
2430 } ,
25- {
26- extends : [
27- ...jsConfig ,
28- ...stylisticConfig ,
29- ...tsConfig ,
30- ...astroPlugin . configs . recommended ,
31- ...astroPlugin . configs [ "jsx-a11y-strict" ] ,
32- ] ,
33- files : [ astroFiles ] ,
34- languageOptions : {
35- parser : astroESLintParser ,
36- parserOptions : {
37- parser : typescriptESLintParserForExtraFiles ,
38- project : true ,
39- projectService : false ,
40- tsconfigRootDir : __dirname ,
41- } ,
42- } ,
43- name : "@virtual-live-lab/eslint-config/astro" ,
44- rules : {
45- "astro/no-set-html-directive" : "error" ,
46- "astro/no-set-text-directive" : "error" ,
47- "astro/no-unused-css-selector" : "error" ,
48- "astro/prefer-class-list-directive" : "error" ,
49- "astro/prefer-object-class-list" : "error" ,
50- "astro/prefer-split-class-list" : "error" ,
51- "astro/sort-attributes" : "error" ,
52- } ,
31+ name : "@virtual-live-lab/eslint-config/astro" ,
32+ rules : {
33+ "astro/no-set-html-directive" : "error" ,
34+ "astro/no-set-text-directive" : "error" ,
35+ "astro/no-unused-css-selector" : "error" ,
36+ "astro/prefer-class-list-directive" : "error" ,
37+ "astro/prefer-object-class-list" : "error" ,
38+ "astro/prefer-split-class-list" : "error" ,
39+ "astro/sort-attributes" : "error" ,
5340 } ,
54- ) ;
41+ } ) ;
0 commit comments