Skip to content

Commit

Permalink
chore: fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
itsacoyote committed Aug 13, 2024
1 parent 02d5823 commit 9e81868
Show file tree
Hide file tree
Showing 17 changed files with 649 additions and 3,572 deletions.
11 changes: 6 additions & 5 deletions .husky/install.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Skip Husky install in production and CI
if (process.env.NODE_ENV === 'production' || process.env.CI === 'true') {
process.exit(0)
}
const husky = (await import('husky')).default
console.log(husky())
if (process.env.NODE_ENV === "production" || process.env.CI === "true") {
process.exit(0);
}
const husky = (await import("husky")).default;
// eslint-disable-next-line no-console
console.log(husky());
1 change: 0 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@

npx --no -- lint-staged

4 changes: 2 additions & 2 deletions .lintstagedrc.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"*.{js,ts,vue}":
- cspell lint --no-must-find-files --files
- eslint --max-warnings=0
- prettier --write --ignore-unknown
- eslint --fix --max-warnings=0
"*.ts":
- tsc-files --noEmit
"*.md":
- cspell lint --no-must-find-files --files

9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules
.github
.idea
public
**/*.md
bin
dist
coverage
build
12 changes: 12 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"bracketSameLine": false,
"printWidth": 80,
"useTabs": false,
"tabWidth": 2,
"semi": true,
"trailingComma": "es5",
"singleQuote": false,
"bracketSpacing": true,
"vueIndentScriptAndStyle": false,
"singleAttributePerLine": true
}
35 changes: 35 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import path from "node:path";
import { fileURLToPath } from "node:url";

import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import eslintConfigPrettier from "eslint-config-prettier";
import { includeIgnoreFile } from "@eslint/compat";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const gitignorePath = path.resolve(__dirname, ".gitignore");

export default [
includeIgnoreFile(gitignorePath),
{ ignores: ["node_modules", "dist", "bin", "build"] },
{ files: ["./src/*.{js,mjs,cjs,ts}"] },
{ languageOptions: { globals: globals.node } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
{
rules: {
"no-console": process.env.NODE_ENV === "production" ? "error" : "warn",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "warn",
"@typescript-eslint/consistent-type-imports": [
"error",
{
prefer: "type-imports",
disallowTypeAnnotations: true,
},
],
},
},
eslintConfigPrettier,
];
Loading

0 comments on commit 9e81868

Please sign in to comment.