-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update format and lint config
- Loading branch information
Showing
22 changed files
with
896 additions
and
725 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ permissions: | |
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
- "v*" | ||
|
||
jobs: | ||
release: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,6 @@ | ||
{ | ||
// Enable the ESlint flat config support | ||
"eslint.experimental.useFlatConfig": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true, | ||
|
||
// Disable the default formatter, use eslint instead | ||
"prettier.enable": false, | ||
"editor.formatOnSave": false, | ||
|
||
// Auto fix | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll": "explicit", | ||
"source.organizeImports": "never" | ||
}, | ||
|
||
// Silent the stylistic rules in you IDE, but still auto fix them | ||
"eslint.rules.customizations": [ | ||
{ "rule": "style/*", "severity": "off" }, | ||
{ "rule": "*-indent", "severity": "off" }, | ||
{ "rule": "*-spacing", "severity": "off" }, | ||
{ "rule": "*-spaces", "severity": "off" }, | ||
{ "rule": "*-order", "severity": "off" }, | ||
{ "rule": "*-dangle", "severity": "off" }, | ||
{ "rule": "*-newline", "severity": "off" }, | ||
{ "rule": "*quotes", "severity": "off" }, | ||
{ "rule": "*semi", "severity": "off" } | ||
], | ||
|
||
// Enable eslint for all supported languages | ||
"eslint.validate": [ | ||
"javascript", | ||
"javascriptreact", | ||
"typescript", | ||
"typescriptreact", | ||
"vue", | ||
"html", | ||
"markdown", | ||
"json", | ||
"jsonc", | ||
"yaml" | ||
] | ||
"eslint.experimental.useFlatConfig": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,53 @@ | ||
// @ts-check | ||
import antfu from '@antfu/eslint-config' | ||
import process from "node:process" | ||
import ts from "@typescript-eslint/eslint-plugin" | ||
import tsParser from "@typescript-eslint/parser" | ||
import prettier from "eslint-config-prettier" | ||
import unicorn from "eslint-plugin-unicorn" | ||
|
||
export default antfu( | ||
const files = ["src/**/*.{ts,tsx}"] | ||
const languageOptions = { | ||
parser: tsParser, | ||
parserOptions: { | ||
project: true, | ||
tsconfigRootDir: process.cwd(), | ||
}, | ||
} | ||
const linterOptions = { | ||
reportUnusedDisableDirectives: true, | ||
} | ||
const plugins = { | ||
"@typescript-eslint": ts, | ||
prettier, | ||
unicorn, | ||
} | ||
|
||
export default [ | ||
{ | ||
ignores: [ | ||
// eslint ignore globs here | ||
'playground/package.json', | ||
], | ||
files, | ||
languageOptions, | ||
linterOptions, | ||
plugins, | ||
rules: { | ||
...ts.configs["strict-type-checked"]?.rules, | ||
"@typescript-eslint/no-non-null-assertion": "off", | ||
"@typescript-eslint/no-unused-vars": "off", | ||
"@typescript-eslint/no-import-type-side-effects": "error", | ||
|
||
...unicorn.configs.recommended.rules, | ||
"unicorn/prevent-abbreviations": "off", | ||
"unicorn/catch-error-name": "off", | ||
"unicorn/prefer-top-level-await": "off", | ||
"unicorn/no-null": "off", | ||
}, | ||
}, | ||
// disable formatting rules, make sure to put this last | ||
{ | ||
files, | ||
languageOptions, | ||
linterOptions, | ||
plugins, | ||
rules: { | ||
// overrides | ||
...prettier.rules, | ||
}, | ||
}, | ||
) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,4 +26,4 @@ | |
"preview": "vite preview" | ||
}, | ||
"type": "module" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { defineConfig, presetUno } from 'unocss' | ||
import { presetShadcn } from 'unocss-preset-shadcn' | ||
import { defineConfig, presetUno } from "unocss" | ||
import { presetShadcn } from "unocss-preset-shadcn" | ||
|
||
export default defineConfig({ | ||
presets: [ | ||
presetUno(), | ||
presetShadcn({ | ||
color: 'red', | ||
color: "red", | ||
}), | ||
], | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import path from 'node:path' | ||
import { defineConfig } from 'vite' | ||
import react from '@vitejs/plugin-react' | ||
import UnoCSS from 'unocss/vite' | ||
import path from "node:path" | ||
import react from "@vitejs/plugin-react" | ||
import UnoCSS from "unocss/vite" | ||
import { defineConfig } from "vite" | ||
|
||
export default defineConfig({ | ||
plugins: [react(), UnoCSS()], | ||
resolve: { | ||
alias: { | ||
'@': path.resolve(__dirname, './src'), | ||
"@": path.resolve(__dirname, "./src"), | ||
}, | ||
}, | ||
}) |
Oops, something went wrong.