Skip to content

Commit 177a558

Browse files
committed
feat: support Eslint 9
1 parent 3a3f16e commit 177a558

26 files changed

+563
-438
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist/
2+
node_modules/

.eslintrc.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
{
2-
"cSpell.words": [
3-
"astrojs",
4-
"Globified",
5-
"globify"
6-
],
2+
"cSpell.words": ["astrojs", "Globified", "globify"],
73
"explorer.fileNesting.patterns": {
84
"index.js": "*.js"
95
}

eslint.config.cjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
const config = require("./index.js")
2+
module.exports = config

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@
3434
"@typescript-eslint/eslint-plugin": "7.13.0",
3535
"@typescript-eslint/parser": "7.13.0",
3636
"anymatch": "^3.1.3",
37-
"eslint": "^8.57.0",
37+
"eslint": "^9.4.0",
3838
"eslint-config-prettier": "^9.1.0",
39-
"eslint-plugin-astro": "^0.34.0",
39+
"eslint-plugin-astro": "^1.2.2",
4040
"eslint-plugin-html": "^8.1.1",
4141
"eslint-plugin-import": "^2.29.1",
42-
"eslint-plugin-json": "^3.1.0",
42+
"eslint-plugin-json": "^4.0.0",
4343
"eslint-plugin-node": "^11.1.0",
4444
"eslint-plugin-only-warn": "npm:@aminya/eslint-plugin-only-warn@^1.2.2",
4545
"eslint-plugin-optimize-regex": "^1.2.1",
4646
"eslint-plugin-react": "^7.34.2",
4747
"eslint-plugin-solid": "^0.14.0",
48-
"eslint-plugin-yaml": "^0.5.0",
48+
"eslint-plugin-yaml": "^1.0.0",
4949
"globify-gitignore": "^1.0.3",
5050
"make-synchronous": "^0.1.1",
5151
"prettier": "3.3.2",
@@ -65,7 +65,7 @@
6565
"@types/shelljs": "^0.8.15",
6666
"eslint-config-atomic": "link:",
6767
"execa": "^5.1.1",
68-
"gitly": "^2.5.3",
68+
"gitly": "^3.0.0",
6969
"npm-check-updates": "16.14.20",
7070
"prettier-config-atomic": "^4.0.0",
7171
"shelljs": "^0.8.5",

pnpm-lock.yaml

Lines changed: 252 additions & 273 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

prettier.config.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import config from "prettier-config-atomic"
2+
export default config

src/astro.cts

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
1-
import { Linter } from "eslint"
1+
import type { Linter } from "eslint"
22
import { pluginImportAstroRulesExtra } from "./plugin-import-rules.cjs"
3+
import astroPlugin from "eslint-plugin-astro"
4+
import * as onlyWarnPlugin from "eslint-plugin-only-warn"
5+
import astroParser from "astro-eslint-parser"
36

4-
export const astroConfig: Linter.ConfigOverride<Linter.RulesRecord> = {
7+
export const astroConfig: Linter.FlatConfig<Linter.RulesRecord> = {
58
// astro files
9+
...astroPlugin.configs.recommended,
610
files: ["*.astro"],
7-
parser: "astro-eslint-parser",
8-
parserOptions: {
9-
parser: "@typescript-eslint/parser",
10-
extraFileExtensions: [".astro"],
11+
languageOptions: {
12+
parser: astroParser,
13+
parserOptions: {
14+
parser: "@typescript-eslint/parser",
15+
extraFileExtensions: [".astro"],
16+
},
17+
globals: {
18+
astroHTML: "readonly",
19+
},
1120
},
12-
plugins: ["astro", "only-warn"],
13-
extends: ["plugin:astro/recommended"],
14-
rules: {
15-
...pluginImportAstroRulesExtra
21+
plugins: {
22+
astro: astroPlugin,
23+
"only-warn": onlyWarnPlugin,
1624
},
17-
globals: {
18-
astroHTML: "readonly",
25+
rules: {
26+
...pluginImportAstroRulesExtra,
1927
},
2028
}

src/coffeescript.cts

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
11
import { pluginNodeRules } from "./plugin-node-rules.cjs"
22
import { pluginImportRulesExtra } from "./plugin-import-rules.cjs"
3-
import { Linter } from "eslint"
3+
import type { Linter } from "eslint"
4+
import * as eslintPluginCoffee from "eslint-plugin-coffee"
5+
import * as onlyWarnPlugin from "eslint-plugin-only-warn"
6+
import * as nodePlugin from "eslint-plugin-node"
7+
import * as coffeeParser from "eslint-plugin-coffee/parser"
8+
import * as optimizeRegexPlugin from "eslint-plugin-optimize-regex"
49

5-
export const coffeeConfig: Linter.ConfigOverride<Linter.RulesRecord> = {
10+
export const coffeeConfig: Linter.FlatConfig<Linter.RulesRecord> = {
611
// CoffeeScript files
12+
...eslintPluginCoffee.configs!.recommended,
13+
...optimizeRegexPlugin.configs!.all,
14+
...eslintPluginCoffee.configs!.prettier,
715
files: ["**/*.coffee"],
8-
parser: "eslint-plugin-coffee",
9-
plugins: ["coffee", "node", "only-warn"],
10-
extends: ["plugin:coffee/eslint-recommended", "plugin:optimize-regex/all", "plugin:coffee/prettier"],
16+
languageOptions: {
17+
parser: coffeeParser,
18+
},
19+
plugins: {
20+
coffee: eslintPluginCoffee,
21+
node: nodePlugin,
22+
"only-warn": onlyWarnPlugin,
23+
},
1124
rules: {
1225
...pluginNodeRules,
1326
...pluginImportRulesExtra,

src/cson.cts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Linter } from "eslint"
1+
import type { Linter } from "eslint"
22
import { coffeeConfig } from "./coffeescript.cjs"
33

4-
export const csonConfig: Linter.ConfigOverride<Linter.RulesRecord> = {
4+
export const csonConfig: Linter.FlatConfig<Linter.RulesRecord> = {
55
...coffeeConfig,
66
files: ["**/*.cson"],
77
rules: {

0 commit comments

Comments
 (0)