Skip to content

Commit

Permalink
feat: eslint 설정 및 중복 import 방지 규칙 추가 (#64)
Browse files Browse the repository at this point in the history
* feat: add eslint for additional rules

* fix: pnpm exec
  • Loading branch information
noahluftyang authored Jan 1, 2025
1 parent e6f76c0 commit 4656c79
Show file tree
Hide file tree
Showing 19 changed files with 618 additions and 253 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: 의존성 설치
run: pnpm install
- name: 린트
run: pnpm --filter="...[origin/${{ github.base_ref }}]" lint
run: pnpm --filter="...[origin/${{ github.base_ref }}]" "/lint:*/"
- name: 테스트
run: pnpm --filter="...[origin/${{ github.base_ref }}]" test
- name: 타입 체크
Expand Down
4 changes: 2 additions & 2 deletions .templates/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
"build": "tsup",
"build:storybook": "storybook build",
"dev:storybook": "storybook dev -p 6006",
"lint": "biome lint .",
"lint:biome": "pnpm exec biome lint",
"lint:eslint": "pnpm exec eslint --flag unstable_ts_config",
"test": "vitest",
"typecheck": "tsc",
"prepack": "pnpm run build"
},
"devDependencies": {
"@biomejs/biome": "catalog:",
"@storybook/addon-essentials": "catalog:",
"@storybook/addon-interactions": "catalog:",
"@storybook/addon-links": "catalog:",
Expand Down
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"recommendations": ["biomejs.biome"]
"recommendations": ["biomejs.biome", "dbaeumer.vscode-eslint"]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
"editor.codeActionsOnSave": {
"quickfix.biome": "explicit",
"source.organizeImports.biome": "explicit"
},
"eslint.options": {
"flags": ["unstable_ts_config"]
}
}
17 changes: 17 additions & 0 deletions eslint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import parser from '@typescript-eslint/parser';
import type { Linter } from 'eslint';

export default [
{
files: ['**/*.{js,ts,tsx}'],
languageOptions: {
parser,
},
},
{ ignores: ['**/dist/'] },
{
rules: {
'no-duplicate-imports': 'error',
},
},
] satisfies Linter.Config[];
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dev:storybook": "storybook dev -p 6006"
},
"devDependencies": {
"@biomejs/biome": "catalog:",
"@biomejs/biome": "^1.9.4",
"@changesets/cli": "^2.27.9",
"@storybook/addon-essentials": "catalog:",
"@storybook/addon-interactions": "catalog:",
Expand All @@ -18,8 +18,10 @@
"@storybook/test": "catalog:",
"@tsconfig/strictest": "^2.0.5",
"@types/node": "^22.8.1",
"@typescript-eslint/parser": "^8.19.0",
"@vitest/coverage-v8": "2.1.4",
"chromatic": "^11.19.0",
"eslint": "^9.17.0",
"knip": "catalog:",
"sanitize.css": "^13.0.0",
"storybook": "catalog:",
Expand Down
8 changes: 3 additions & 5 deletions packages/Input/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@
},
"type": "module",
"exports": "./src/index.ts",
"files": [
"dist"
],
"files": ["dist"],
"scripts": {
"build": "tsup",
"build:storybook": "storybook build",
"dev:storybook": "storybook dev -p 6006",
"lint": "biome lint .",
"lint:biome": "pnpm exec biome lint",
"lint:eslint": "pnpm exec eslint --flag unstable_ts_config",
"test": "vitest",
"typecheck": "tsc",
"prepack": "pnpm run build"
Expand All @@ -26,7 +25,6 @@
"classnames": "^2.5.1"
},
"devDependencies": {
"@biomejs/biome": "catalog:",
"@storybook/addon-essentials": "catalog:",
"@storybook/addon-interactions": "catalog:",
"@storybook/addon-links": "catalog:",
Expand Down
8 changes: 3 additions & 5 deletions packages/badge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@
},
"type": "module",
"exports": "./src/index.ts",
"files": [
"dist"
],
"files": ["dist"],
"scripts": {
"build": "tsup",
"build:storybook": "storybook build",
"dev:storybook": "storybook dev -p 6006",
"lint": "biome lint .",
"lint:biome": "pnpm exec biome lint",
"lint:eslint": "pnpm exec eslint --flag unstable_ts_config",
"test": "vitest",
"typecheck": "tsc",
"prepack": "pnpm run build"
Expand All @@ -26,7 +25,6 @@
"clsx": "^2.1.1"
},
"devDependencies": {
"@biomejs/biome": "catalog:",
"@storybook/addon-essentials": "catalog:",
"@storybook/addon-interactions": "catalog:",
"@storybook/addon-links": "catalog:",
Expand Down
4 changes: 2 additions & 2 deletions packages/card/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"build": "tsup",
"build:storybook": "storybook build",
"dev:storybook": "storybook dev -p 6006",
"lint": "biome lint .",
"lint:biome": "pnpm exec biome lint",
"lint:eslint": "pnpm exec eslint --flag unstable_ts_config",
"test": "vitest",
"typecheck": "tsc",
"prepack": "pnpm run build"
Expand All @@ -25,7 +26,6 @@
"clsx": "^2.1.1"
},
"devDependencies": {
"@biomejs/biome": "catalog:",
"@storybook/addon-essentials": "catalog:",
"@storybook/addon-interactions": "catalog:",
"@storybook/addon-links": "catalog:",
Expand Down
8 changes: 3 additions & 5 deletions packages/divider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,18 @@
},
"type": "module",
"exports": "./src/index.ts",
"files": [
"dist"
],
"files": ["dist"],
"scripts": {
"build": "tsup",
"build:storybook": "storybook build",
"dev:storybook": "storybook dev -p 6006",
"lint": "biome lint .",
"lint:biome": "pnpm exec biome lint",
"lint:eslint": "pnpm exec eslint --flag unstable_ts_config",
"test": "vitest",
"typecheck": "tsc",
"prepack": "pnpm run build"
},
"devDependencies": {
"@biomejs/biome": "catalog:",
"@sipe-team/typography": "workspace:*",
"@storybook/addon-essentials": "catalog:",
"@storybook/addon-interactions": "catalog:",
Expand Down
8 changes: 3 additions & 5 deletions packages/radio-group/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,18 @@
},
"type": "module",
"exports": "./src/index.ts",
"files": [
"dist"
],
"files": ["dist"],
"scripts": {
"build": "tsup",
"build:storybook": "storybook build",
"dev:storybook": "storybook dev -p 6006",
"lint": "biome lint .",
"lint:biome": "pnpm exec biome lint",
"lint:eslint": "pnpm exec eslint --flag unstable_ts_config",
"test": "vitest",
"typecheck": "tsc",
"prepack": "pnpm run build"
},
"devDependencies": {
"@biomejs/biome": "catalog:",
"@storybook/addon-essentials": "catalog:",
"@storybook/addon-interactions": "catalog:",
"@storybook/addon-links": "catalog:",
Expand Down
3 changes: 1 addition & 2 deletions packages/radio-group/src/RadioGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { createContext, useId } from 'react';
import type { PropsWithChildren } from 'react';
import { type PropsWithChildren, createContext, useId } from 'react';
import styles from './RadioGroup.module.css';

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/skeleton/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
"build": "tsup",
"build:storybook": "storybook build",
"dev:storybook": "storybook dev -p 6006",
"lint": "biome lint .",
"lint:biome": "pnpm exec biome lint",
"lint:eslint": "pnpm exec eslint --flag unstable_ts_config",
"test": "vitest",
"typecheck": "tsc",
"prepack": "pnpm run build"
},
"devDependencies": {
"@biomejs/biome": "catalog:",
"@faker-js/faker": "^9.2.0",
"@storybook/addon-essentials": "catalog:",
"@storybook/addon-interactions": "catalog:",
Expand Down
8 changes: 3 additions & 5 deletions packages/switch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,18 @@
},
"type": "module",
"exports": "./src/index.ts",
"files": [
"dist"
],
"files": ["dist"],
"scripts": {
"build": "tsup",
"build:storybook": "storybook build",
"dev:storybook": "storybook dev -p 6006",
"lint": "biome lint .",
"lint:biome": "pnpm exec biome lint",
"lint:eslint": "pnpm exec eslint --flag unstable_ts_config",
"test": "vitest",
"typecheck": "tsc",
"prepack": "pnpm run build"
},
"devDependencies": {
"@biomejs/biome": "catalog:",
"@faker-js/faker": "^9.2.0",
"@storybook/addon-essentials": "catalog:",
"@storybook/addon-interactions": "catalog:",
Expand Down
8 changes: 3 additions & 5 deletions packages/tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,17 @@
},
"type": "module",
"exports": "./src/index.ts",
"files": [
"dist"
],
"files": ["dist"],
"scripts": {
"build": "tsup",
"build:storybook": "storybook build",
"dev:storybook": "storybook dev -p 6006",
"lint": "biome lint .",
"lint:biome": "pnpm exec biome lint",
"lint:eslint": "pnpm exec eslint --flag unstable_ts_config",
"typecheck": "tsc",
"prepack": "pnpm run build"
},
"devDependencies": {
"@biomejs/biome": "catalog:",
"@faker-js/faker": "^9.2.0",
"@sipe-team/typography": "workspace:*",
"@storybook/addon-essentials": "catalog:",
Expand Down
8 changes: 3 additions & 5 deletions packages/tooltip/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@
},
"type": "module",
"exports": "./src/index.ts",
"files": [
"dist"
],
"files": ["dist"],
"scripts": {
"build": "tsup",
"build:storybook": "storybook build",
"dev:storybook": "storybook dev -p 6006",
"lint": "biome lint .",
"lint:biome": "pnpm exec biome lint",
"lint:eslint": "pnpm exec eslint --flag unstable_ts_config",
"test": "vitest",
"typecheck": "tsc",
"prepack": "pnpm run build"
Expand All @@ -29,7 +28,6 @@
"react-dom": "^18.3.1"
},
"devDependencies": {
"@biomejs/biome": "catalog:",
"@faker-js/faker": "^9.2.0",
"@storybook/addon-essentials": "catalog:",
"@storybook/addon-interactions": "catalog:",
Expand Down
4 changes: 2 additions & 2 deletions packages/typography/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"build": "tsup",
"build:storybook": "storybook build",
"dev:storybook": "storybook dev -p 6006",
"lint": "biome lint .",
"lint:biome": "pnpm exec biome lint",
"lint:eslint": "pnpm exec eslint --flag unstable_ts_config",
"test": "vitest",
"typecheck": "tsc",
"prepack": "pnpm run build"
Expand All @@ -25,7 +26,6 @@
"clsx": "^2.1.1"
},
"devDependencies": {
"@biomejs/biome": "catalog:",
"@faker-js/faker": "^9.2.0",
"@storybook/addon-essentials": "catalog:",
"@storybook/addon-interactions": "catalog:",
Expand Down
Loading

0 comments on commit 4656c79

Please sign in to comment.