Skip to content

Commit

Permalink
chore: update eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
ckvv committed Nov 29, 2023
1 parent ddd8d6b commit 3f60329
Show file tree
Hide file tree
Showing 20 changed files with 601 additions and 413 deletions.
15 changes: 0 additions & 15 deletions .eslintrc.cjs

This file was deleted.

1 change: 0 additions & 1 deletion .github/workflows/release-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@ jobs:
- run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

24 changes: 12 additions & 12 deletions .versionrc.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"types": [
{"type": "build", "section": "Features"},
{"type": "chore", "section": "Features"},
{"type": "ci", "section": "Features"},
{"type": "docs", "section": "Docs"},
{"type": "feat", "section": "Features"},
{"type": "fix", "section": "Bug Fixes"},
{"type": "perf", "section": "Features"},
{"type": "refactor", "section": "Features"},
{"type": "revert", "section": "Revert"},
{"type": "style", "section": "Style"},
{"type": "test", "section": "Test"}
{ "type": "build", "section": "Features" },
{ "type": "chore", "section": "Features" },
{ "type": "ci", "section": "Features" },
{ "type": "docs", "section": "Docs" },
{ "type": "feat", "section": "Features" },
{ "type": "fix", "section": "Bug Fixes" },
{ "type": "perf", "section": "Features" },
{ "type": "refactor", "section": "Features" },
{ "type": "revert", "section": "Revert" },
{ "type": "style", "section": "Style" },
{ "type": "test", "section": "Test" }
]
}
}
42 changes: 42 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"editor.inlineSuggest.showToolbar": "onHover",
// Enable the ESlint flat config support
"eslint.experimental.useFlatConfig": true,

// Disable the default formatter, use eslint instead
"prettier.enable": false,
"editor.formatOnSave": false,

// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},

// Silent the stylistic rules in you IDE, but still auto fix them
"eslint.rules.customizations": [
{ "rule": "style/*", "severity": "error" },
{ "rule": "*-indent", "severity": "error" },
{ "rule": "*-spacing", "severity": "error" },
{ "rule": "*-spaces", "severity": "error" },
{ "rule": "*-order", "severity": "error" },
{ "rule": "*-dangle", "severity": "error" },
{ "rule": "*-newline", "severity": "error" },
{ "rule": "*quotes", "severity": "error" },
{ "rule": "*semi", "severity": "error" }
],

// Enable eslint for all supported languages
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml"
]
}
4 changes: 2 additions & 2 deletions dev/components-demos.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
// @ts-expect-error
// eslint-disable-next-line ts/ban-ts-comment
// @ts-nocheck
const modules = import.meta.glob('../docs/_demos/*/*.vue', { eager: true, import: 'default' });

const Cases = Object.keys(modules).reduce((pre: any, cur) => {
Expand Down
9 changes: 6 additions & 3 deletions docs/.vitepress/nav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,18 @@ export function getNav(lang = '') {
text: t('guide'),
link: `${lang}/guide/base/getting-started`,
activeMatch: `^${lang}/guide`,
}, {
},
{
text: t('compoents'),
link: `${lang}/compoents/button`,
activeMatch: `^${lang}/compoents`,
}, {
},
{
text: t('playground'),
link: `${lang}/play`,
activeMatch: `^${lang}/play`,
}, {
},
{
text: t('changelog'),
link: `${lang}/CHANGELOG`,
activeMatch: `^${lang}/CHANGELOG`,
Expand Down
4 changes: 0 additions & 4 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import DefaultTheme from 'vitepress/theme';
import './index.css';

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
import VUI from '@/index';

export default {
...DefaultTheme,
async enhanceApp({ app }) {
app.use(VUI);
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
if (!import.meta.env.SSR) {
const ReplWrapper = (await import('../plugins/repl-wrapper.vue')).default;
app.component('ReplWrapper', ReplWrapper);
Expand Down
21 changes: 21 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import antfu from '@antfu/eslint-config';

export default await antfu({
rules: {
'no-console': 'off',
'curly': ['error', 'multi-line'],
'max-statements-per-line': 'off',
'brace-style': 'off',
'vue/multi-word-component-names': 'off',
'vue/no-v-text-v-html-on-component': 'off',
'vue/no-reserved-component-names': 'off',
'node/prefer-global/process': 'off',
'import/no-duplicates': 'off',
'unused-imports/no-unused-vars': 'off',
'style/brace-style': ['error', '1tbs'],
'style/semi': 'off',
'ts/consistent-type-imports': ['off'],
'ts/semi': ['error', 'always'],
},
ignores: ['./dist', './es'],
});
64 changes: 32 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
{
"name": "@ckpack/v-ui",
"type": "module",
"version": "1.12.1",
"packageManager": "pnpm@7.17.1",
"description": "Quickly create a component library for Vue 3",
"author": "ckvv",
"license": "ISC",
"homepage": "https://ckpack.github.io/v-ui",
"repository": "https://github.com/ckpack/v-ui",
"keywords": [
"vue",
"v-ui",
"vue-ui"
],
"sideEffects": false,
"type": "module",
"main": "es/index.js",
"module": "es/index.js",
"types": "es/index.d.ts",
"packageManager": "pnpm@7.17.1",
"exports": {
".": {
"import": "./es/index.js",
Expand All @@ -19,24 +25,21 @@
"./src": "./src/index.ts",
"./src/*": "./src/*"
},
"repository": "https://github.com/ckpack/v-ui",
"homepage": "https://ckpack.github.io/v-ui",
"author": "ckvv",
"license": "ISC",
"keywords": [
"vue",
"v-ui",
"vue-ui"
],
"main": "es/index.js",
"module": "es/index.js",
"types": "es/index.d.ts",
"files": [
"src/*",
"es/*",
"components.d.ts",
"dist/*",
"components.d.ts"
"es/*",
"src/*"
],
"engines": {
"node": ">=16"
},
"scripts": {
"preinstall": "npx simple-git-hooks",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts,.md --fix --ignore-path .gitignore",
"lint": "eslint . --fix",
"release": "standard-version",
"dev": "vite -c ./dev/vite.config.ts",
"dev:build": "vite build -c ./dev/vite.config.ts",
Expand All @@ -50,35 +53,32 @@
"gen": "tsx ./scripts/gen.ts",
"postgen": "tsx ./scripts/gen-compoents.ts"
},
"peerDependencies": {
"vue": "^3.3.x"
},
"dependencies": {
"@ant-design/colors": "^7.0.0",
"@emotion/css": "^11.11.2",
"async-validator": "^4.2.5"
},
"devDependencies": {
"@vue/repl": "^2.8.1",
"eslint": "^8.54.0",
"@antfu/eslint-config": "0.40.2",
"tsx": "^4.6.0",
"@antfu/eslint-config": "2.1.1",
"@types/node": "^20.x",
"typescript": "5.3.2",
"vite": "^5.0.3",
"@vitejs/plugin-vue": "^4.5.0",
"vite-plugin-dts": "3.6.3",
"@vue/repl": "^2.8.1",
"@vue/tsconfig": "^0.4.0",
"eslint": "^8.54.0",
"fast-glob": "^3.3.2",
"simple-git-hooks": "^2.9.0",
"lint-staged": "^15.1.0",
"simple-git-hooks": "^2.9.0",
"standard-version": "^9.5.0",
"tsx": "^4.6.0",
"typescript": "5.3.2",
"vite": "^5.0.3",
"vite-plugin-dts": "3.6.3",
"vitepress": "1.0.0-rc.31",
"vue": "^3.3.9"
},
"peerDependencies": {
"vue": "^3.3.x"
},
"engines": {
"node": ">=16"
},
"simple-git-hooks": {
"pre-commit": "npx lint-staged",
"commit-msg": "npx tsx scripts/verify-commit.ts"
Expand Down
Loading

0 comments on commit 3f60329

Please sign in to comment.