Skip to content

Commit

Permalink
Migrate ESLint to flat config format properly
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrus21337 committed Jun 28, 2024
1 parent 7120290 commit ae22a36
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 63 deletions.
Binary file modified bun.lockb
Binary file not shown.
34 changes: 34 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import js from "@eslint/js";
import astro from "eslint-plugin-astro";
import typescript from "typescript-eslint";

export default [
js.configs.recommended,
...typescript.configs.recommendedTypeChecked,
...typescript.configs.stylisticTypeChecked,
{
languageOptions: {
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
...astro.configs.recommended,
{
ignores: ["node_modules/", ".astro/"],
},
{
rules: {
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/triple-slash-reference": "off",
"import/no-anonymous-default-export": "off",
"no-console": "warn",
"no-control-regex": "off",
},
},
];
58 changes: 0 additions & 58 deletions eslint.config.mjs

This file was deleted.

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro check && astro build",
"build": "eslint . && astro build",
"preview": "astro preview",
"astro": "astro",
"format": "prettier --write .",
"lint": "eslint .",
"prepare": "husky"
},
"dependencies": {
Expand All @@ -19,22 +20,22 @@
"typescript": "^5.5.2"
},
"devDependencies": {
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.5.0",
"@fontsource-variable/inter-tight": "^5.0.21",
"@ianvs/prettier-plugin-sort-imports": "^4.2.1",
"@typescript-eslint/eslint-plugin": "^7.14.1",
"@typescript-eslint/parser": "^7.14.1",
"@types/eslint__js": "^8.42.3",
"cssnano": "^7.0.3",
"daisyui": "^4.12.8",
"eslint": "^9.5.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-astro": "^1.2.2",
"husky": "^9.0.11",
"lint-staged": "^15.2.7",
"prettier": "^3.3.2",
"prettier-plugin-astro": "^0.14.0",
"prettier-plugin-sort-json": "^4.0.0",
"prettier-plugin-tailwindcss": "^0.6.5",
"tsc-files": "^1.1.4"
"tsc-files": "^1.1.4",
"typescript-eslint": "^7.14.1"
}
}

0 comments on commit ae22a36

Please sign in to comment.