Skip to content

Commit

Permalink
Update ESLint and use flat config
Browse files Browse the repository at this point in the history
  • Loading branch information
winstliu committed Oct 5, 2024
1 parent a48c5a5 commit 189b7c1
Show file tree
Hide file tree
Showing 6 changed files with 829 additions and 1,150 deletions.
35 changes: 0 additions & 35 deletions .eslintrc.cjs

This file was deleted.

26 changes: 26 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import pluginVue from "eslint-plugin-vue";
import vueTsEslintConfig from "@vue/eslint-config-typescript";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";

export default [
...pluginVue.configs["flat/recommended"],
...vueTsEslintConfig({
// TODO: Change to "strictTypeChecked" when https://github.com/vuejs/eslint-config-typescript/issues/85 is fixed.
extends: ["strict"],
}),
{
rules: {
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
"vue/multi-word-component-names": "off",
},
},
{
files: ["tests/**/*.test.ts"],
rules: {
// .to.be.empty, .to.be.true, etc. are valid Vitest assertions.
"@typescript-eslint/no-unused-expressions": "off",
},
},
eslintPluginPrettierRecommended,
];
Loading

0 comments on commit 189b7c1

Please sign in to comment.