Skip to content

Commit

Permalink
Add eslint and fix the resulting errors.
Browse files Browse the repository at this point in the history
This also fixes most of the issues for passing --isolatedDeclarations except for
dotansimha/graphql-code-generator#10160 and
microsoft/TypeScript#58262.
  • Loading branch information
jyasskin committed Oct 3, 2024
1 parent 4f46b0f commit 9f954bd
Show file tree
Hide file tree
Showing 13 changed files with 721 additions and 34 deletions.
24 changes: 24 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
{
rules: {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
},
},
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
ignores: [".astro/", "dist/"],
},
);
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"preview": "astro preview",
"astro": "astro",
"codegen": "graphql-codegen --config gql-codegen.config.ts && prisma generate",
"test": "astro check && vitest"
"test": "eslint . && tsc && astro check && vitest"
},
"dependencies": {
"@astrojs/node": "^8.3.4",
Expand All @@ -29,17 +29,21 @@
},
"devDependencies": {
"@astrojs/check": "^0.9.3",
"@eslint/js": "^9.11.1",
"@graphql-codegen/cli": "^5.0.2",
"@graphql-codegen/client-preset": "^4.3.3",
"@graphql-codegen/typescript": "^4.0.9",
"@graphql-codegen/typescript-document-nodes": "^4.0.9",
"@octokit/graphql-schema": "^15.25.0",
"@types/eslint__js": "^8.42.3",
"@types/mdast": "^4.0.4",
"@types/node": "^22.5.5",
"@types/unist": "^3.0.3",
"eslint": "^9.11.1",
"prettier": "^3.3.3",
"prettier-plugin-astro": "^0.14.1",
"typescript": "^5.6.2",
"typescript-eslint": "^8.8.0",
"vitest": "^2.1.1"
},
"engines": {
Expand Down
Loading

0 comments on commit 9f954bd

Please sign in to comment.