diff --git a/.changeset/large-kangaroos-build.md b/.changeset/large-kangaroos-build.md new file mode 100644 index 00000000..1c91ad2c --- /dev/null +++ b/.changeset/large-kangaroos-build.md @@ -0,0 +1,5 @@ +--- +"eslint-plugin-astro": major +--- + +feat!: use astro-eslint-parser v1 diff --git a/package.json b/package.json index 43e6b6b1..313c231f 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "build:ts": "tsc --project ./tsconfig.build.json", "clean": "rimraf lib .nyc_output dist coverage", "test": "npm run mocha -- \"tests/src/**/*.ts\" --reporter dot --timeout 60000 && npm run test:type", - "test:type": "tsc", + "test:type": "tsc --noEmit", "cover": "nyc --reporter=lcov npm run test", "debug": "npm run mocha -- \"tests/src/**/*.ts\" --reporter dot --timeout 60000", "lint": "eslint .", @@ -56,8 +56,8 @@ "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@jridgewell/sourcemap-codec": "^1.4.14", - "@typescript-eslint/types": "^5.25.0", - "astro-eslint-parser": "^0.17.0", + "@typescript-eslint/types": "^7.7.1", + "astro-eslint-parser": "^1.0.1", "eslint-compat-utils": "^0.5.0", "globals": "^13.0.0", "postcss": "^8.4.14", @@ -86,8 +86,8 @@ "@types/react": "^18.0.15", "@types/semver": "^7.3.9", "@types/stylus": "^0.48.38", - "@typescript-eslint/eslint-plugin": "^7.0.0", - "@typescript-eslint/parser": "^7.0.0", + "@typescript-eslint/eslint-plugin": "^7.7.1", + "@typescript-eslint/parser": "^7.7.1", "assert": "^2.0.0", "astro": "^4.5.0", "env-cmd": "^10.1.0", diff --git a/src/rules/semi.ts b/src/rules/semi.ts index 5965f0d6..096105e4 100644 --- a/src/rules/semi.ts +++ b/src/rules/semi.ts @@ -381,7 +381,7 @@ export default createRule("semi", { function checkForSemicolonForVariableDeclaration( node: TSESTree.VariableDeclaration, ) { - const parent = node.parent! + const parent = node.parent if ( (parent.type !== "ForStatement" || parent.init !== node) && diff --git a/src/utils/ast-utils.ts b/src/utils/ast-utils.ts index 5e7cf484..c26e5822 100644 --- a/src/utils/ast-utils.ts +++ b/src/utils/ast-utils.ts @@ -296,7 +296,7 @@ function getParentSyntaxParen( | TSESTree.PrivateIdentifier, sourceCode: SourceCode, ) { - const parent = node.parent! + const parent = node.parent switch (parent.type) { case "CallExpression":