Skip to content

Commit

Permalink
chore: add eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
axetroy committed Aug 19, 2023
1 parent 11a31ff commit 9fb8ffc
Show file tree
Hide file tree
Showing 7 changed files with 1,046 additions and 2 deletions.
18 changes: 18 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": ["plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "simple-import-sort", "import", "unused-imports"],
"rules": {
"no-var": "error",
"@typescript-eslint/no-unused-vars": "error",
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"import/first": "off",
"import/newline-after-import": "error",
"import/no-duplicates": "error",

"prettier/prettier": "error",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": ["error", { "vars": "all", "varsIgnorePattern": "^_", "args": "none", "argsIgnorePattern": "^_" }]
}
}
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
- name: Install
run: pnpm install

- name: Lint
run: pnpm lint

- name: Compiler
run: pnpm build

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules
dist
.DS_Store
.pnpm-store
*.log
11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"build": "pnpm -r --aggregate-output --filter=./packages/* build",
"test": "pnpm -r --aggregate-output --filter=./packages/* test",
"format": "prettier **/*.{js,jsx,ts,json,md} --write",
"lint": "eslint --fix packages/**/*.ts",
"changeset:release": "pnpm build && pnpm publish -r --access public --registry=https://registry.npmjs.org",
"changeset:version": "changeset version && pnpm install --lockfile-only",
"prepublishOnly": "pnpm build"
Expand All @@ -23,7 +24,17 @@
"@changesets/cli": "^2.26.2",
"@types/jest": "^29.5.3",
"@types/node": "^20.4.5",
"@typescript-eslint/eslint-plugin": "6.2.1",
"@typescript-eslint/parser": "6.2.1",
"babel-jest": "^29.6.2",
"eslint": "8.46.0",
"eslint-config-prettier": "8.10.0",
"eslint-config-standard": "17.1.0",
"eslint-plugin-n": "16.0.1",
"eslint-plugin-prettier": "5.0.0",
"eslint-plugin-promise": "6.1.1",
"eslint-plugin-simple-import-sort": "10.0.0",
"eslint-plugin-unused-imports": "3.0.0",
"jest": "^29.6.2",
"jest-cli": "^29.6.2",
"prettier": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/gen-react/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";

export default defineConfig({
plugins: [react()],
Expand Down
2 changes: 1 addition & 1 deletion packages/gen-vue/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from "vite";
import vue2 from "@vitejs/plugin-vue2";
import { defineConfig } from "vite";

export default defineConfig({
plugins: [vue2()],
Expand Down
Loading

0 comments on commit 9fb8ffc

Please sign in to comment.