Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint 규칙상 불필요한 경우에도 dependencies 모듈 사용이 강제되는 문제 해결 #75

Merged
merged 3 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion commitlint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

export default {
extends: ["@commitlint/config-conventional"],
};
22 changes: 17 additions & 5 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/* eslint-disable no-underscore-dangle */
import pluginJs from "@eslint/js";
// eslint-disable-next-line import/no-unresolved
import tseslint from "typescript-eslint";
import prettierConfig from "eslint-config-prettier";
import prettierPluginRecommended from "eslint-plugin-prettier/recommended";
import tseslint from "typescript-eslint";

/** @see https://www.raulmelo.me/en/blog/migration-eslint-to-flat-config */
import { FlatCompat } from "@eslint/eslintrc";
Expand All @@ -20,12 +19,25 @@ const compat = new FlatCompat({
/** @type {import('eslint').Linter.Config[]} */
export default [
{ files: ["**/*.{js,mjs,cjs,ts}"] },
{
ignores: ["*.config.js"]
},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
...compat.extends("airbnb-base"),
prettierConfig,
prettierPluginRecommended,
{
rules: {
"import/no-extraneous-dependencies": [
"warn",
{
devDependencies: [
"**/*.config.{mts,ts,mjs,js}",
"**/storybook/**",
"**/stories/**",
"**/*.stories.{ts,tsx,js,jsx}",
"**/*.{spec,test}.{ts,tsx,js,jsx}",
],
},
],
},
},
];
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "",
"private": "true",
"scripts": {
"lint": "eslint",
"lint": "eslint --filter \"frontend,backend\" lint",
"test": "echo \"Error: no test specified\" && exit 1",
"prepare": "husky"
},
Expand All @@ -20,15 +20,14 @@
"lint-staged": "^15.2.10",
"prettier": "3.3.3",
"typescript": "^5.6.3",
"typescript-eslint": "^8.13.0"
},
"dependencies": {
"typescript-eslint": "^8.13.0",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.14.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1"
},
"dependencies": {},
"lint-staged": {
"src/**/*.{js,jsx,ts,tsx}": [
"eslint --cache --fix",
Expand Down