Skip to content

Commit 190b2c3

Browse files
committed
fix: fix bugs with solid and astro support
1 parent 037337c commit 190b2c3

File tree

5 files changed

+31
-7
lines changed

5 files changed

+31
-7
lines changed

.vscode/settings.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
2-
"cSpell.words": ["Globified", "globify"],
2+
"cSpell.words": [
3+
"astrojs",
4+
"Globified",
5+
"globify"
6+
],
37
"explorer.fileNesting.patterns": {
48
"index.js": "*.js"
59
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-config-atomic",
3-
"version": "1.21.1",
3+
"version": "1.21.2",
44
"description": "Eslint config used in atom-ide-community",
55
"repository": "https://github.com/atom-ide-community/eslint-config-atomic",
66
"license": "MIT",
@@ -36,6 +36,7 @@
3636
"anymatch": "^3.1.3",
3737
"eslint": "^8.57.0",
3838
"eslint-config-prettier": "^9.1.0",
39+
"eslint-plugin-astro": "^0.31.4",
3940
"eslint-plugin-html": "^8.0.0",
4041
"eslint-plugin-import": "^2.29.1",
4142
"eslint-plugin-json": "^3.1.0",
@@ -44,7 +45,6 @@
4445
"eslint-plugin-optimize-regex": "^1.2.1",
4546
"eslint-plugin-react": "^7.34.0",
4647
"eslint-plugin-solid": "^0.13.1",
47-
"eslint-plugin-astro": "^0.31.4",
4848
"eslint-plugin-yaml": "^0.5.0",
4949
"globify-gitignore": "^1.0.3",
5050
"make-synchronous": "^0.1.1",

src/astro.cts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Linter } from "eslint"
2+
import { pluginImportAstroRulesExtra } from "./plugin-import-rules.cjs"
23

34
export const astroConfig: Linter.ConfigOverride<Linter.RulesRecord> = {
45
// astro files
@@ -10,4 +11,10 @@ export const astroConfig: Linter.ConfigOverride<Linter.RulesRecord> = {
1011
},
1112
plugins: ["astro", "only-warn"],
1213
extends: ["plugin:astro/recommended"],
14+
rules: {
15+
...pluginImportAstroRulesExtra
16+
},
17+
globals: {
18+
astroHTML: "readonly",
19+
},
1320
}

src/index-solid.cts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ import { tsConfig } from "./typescript.cjs"
44

55
const nonStrictConfig: Linter.Config = {
66
...base,
7-
plugins: ["solid", ...(base.plugins ?? [])],
8-
extends: ["plugin:solid/recommended", ...(base.extends ?? [])],
97
overrides: [
8+
// JavaScript:
9+
{
10+
files: ["*.js", "*.jsx", "*.mjs", "*.cjs"],
11+
plugins: ["solid", ...(base.plugins ?? [])],
12+
extends: ["plugin:solid/recommended", ...(base.extends ?? [])],
13+
},
1014
// TypeScript:
1115
{
1216
...tsConfig,

src/plugin-import-rules.cts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,26 @@ export const pluginImportTypeScriptRulesExtra: Linter.RulesRecord = {
2424
"import/namespace": "off",
2525
}
2626

27+
export const pluginImportAstroRulesExtra: Linter.RulesRecord = {
28+
// Buggy on Astro:
29+
"import/default": "off",
30+
"import/no-absolute-path": "off",
31+
"import/no-unresolved": "off",
32+
"import/no-extraneous-dependencies": "off",
33+
}
34+
2735
export const pluginImportSettings = {
2836
"import/core-modules": ["atom", "electron"],
2937
// support TypeScript and Coffee importing
30-
"import/extensions": [".ts", ".tsx", ".cts", ".mts", ".d.ts", ".js", ".cjs", ".mjs", ".jsx", ".coffee"],
38+
"import/extensions": [".ts", ".tsx", ".cts", ".mts", ".d.ts", ".js", ".cjs", ".mjs", ".jsx", ".coffee", ".astro"],
3139
"import/external-module-folders": ["node_modules", "node_modules/@types"],
3240
"import/parsers": {
3341
"@typescript-eslint/parser": [".ts", ".tsx", ".d.ts"],
42+
"astro-eslint-parser": [".astro"],
3443
},
3544
"import/resolver": {
3645
node: {
37-
extensions: [".ts", ".tsx", ".cts", ".mts", ".d.ts", ".js", ".cjs", ".mjs", ".jsx", ".coffee"],
46+
extensions: [".ts", ".tsx", ".cts", ".mts", ".d.ts", ".js", ".cjs", ".mjs", ".jsx", ".coffee", ".astro"],
3847
},
3948
},
4049
}

0 commit comments

Comments
 (0)