Skip to content

Commit

Permalink
chore: add more eslint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan-Y-Ko committed Jan 15, 2025
1 parent a8c65bf commit 33998c4
Show file tree
Hide file tree
Showing 3 changed files with 1,161 additions and 1 deletion.
41 changes: 40 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import eslintPluginPrettier from "eslint-plugin-prettier";
import importPlugin from "eslint-plugin-import";
import { fileURLToPath } from "url";
import { dirname } from "path";

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

/** @type {import('eslint').Linter.Config[]} */
export default [
Expand All @@ -10,14 +16,47 @@ export default [
pluginJs.configs.recommended,
...tseslint.configs.recommended,
{
languageOptions: {
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: __dirname,
},
},
plugins: {
prettier: eslintPluginPrettier,
import: importPlugin,
},
rules: {
"prettier/prettier": "error",
"@typescript-eslint/naming-convention": [
"error",
{
selector: "interface",
format: ["PascalCase"],
},
],
"no-console": "error",
"import/order": 2,
"no-nested-ternary": 2,
"@typescript-eslint/consistent-type-imports": [
"error",
{
prefer: "type-imports",
},
],
"dot-notation": "off",
"@typescript-eslint/dot-notation": "error",
},
},
{
ignores: ["dist/", "node_modules/**/*"],
ignores: [
"dist/",
"node_modules/**/*",
"commitlint.config.mjs",
"**/*.config.js",
"generate-exports.js",
"vite.config.ts",
"**/*.test.ts",
],
},
];
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"@typescript-eslint/parser": "^8.20.0",
"eslint": "^9.18.0",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.2.1",
"globals": "^15.14.0",
"husky": "^9.1.7",
Expand Down
Loading

0 comments on commit 33998c4

Please sign in to comment.