Skip to content

Commit

Permalink
chore: add eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan-Y-Ko committed Jan 15, 2025
1 parent 09e8457 commit b037e92
Show file tree
Hide file tree
Showing 6 changed files with 3,999 additions and 4,097 deletions.
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh
pnpm format:changed
pnpm lint
pnpm build
node generate-exports.js
2 changes: 1 addition & 1 deletion commitlint.config.cjs → commitlint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
export default {
extends: ["@commitlint/config-conventional"],
};
31 changes: 31 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import pluginReact from "eslint-plugin-react";
import eslintPluginPrettier from "eslint-plugin-prettier";

/** @type {import('eslint').Linter.Config[]} */
export default [
{ files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"] },
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
{
settings: {
react: {
version: "detect",
},
},
plugins: {
prettier: eslintPluginPrettier,
},
rules: {
"prettier/prettier": "error",
"react/react-in-jsx-scope": "off",
},
},
{
ignores: ["dist/", "node_modules/**/*"],
},
];
17 changes: 15 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"build-storybook:css": "tailwindcss -m -i ./src/style.css -o ./src/index.css",
"prepublishOnly": "pnpm build",
"format:changed": "git diff --name-only --diff-filter=d HEAD | grep -e 'src.*\\.[jt]sx\\?$' -e 'src.*\\.json$' -e 'src.*\\.css$' -e 'src.*\\.md$' | xargs prettier -u --write",
"prepare": "husky install"
"prepare": "husky install",
"lint": "eslint ."
},
"keywords": [],
"author": "",
Expand All @@ -43,9 +44,19 @@
"@storybook/theming": "^8.4.6",
"@types/node": "^22.9.3",
"@types/react": "^18.3.12",
"@typescript-eslint/eslint-plugin": "^8.20.0",
"@typescript-eslint/parser": "^8.20.0",
"@vitejs/plugin-react": "^4.3.3",
"autoprefixer": "^10.4.20",
"concurrently": "^9.1.0",
"eslint": "^9.18.0",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-prettier": "^5.2.2",
"eslint-plugin-react": "^7.37.4",
"eslint-plugin-react-hooks": "^5.1.0",
"globals": "^15.14.0",
"husky": "^9.1.7",
"postcss": "^8.4.49",
"prettier": "^3.4.2",
Expand All @@ -56,7 +67,9 @@
"storybook": "8.4.7",
"tailwindcss": "^3.4.15",
"typescript": "^5.7.2",
"vite": "^5.4.11"
"typescript-eslint": "^8.20.0",
"vite": "^5.4.11",
"vite-plugin-eslint": "^1.8.1"
},
"peerDependencies": {
"react": "^18.0.0",
Expand Down
Loading

0 comments on commit b037e92

Please sign in to comment.