Skip to content

Commit

Permalink
feat: update eslint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
09473ZH committed Dec 14, 2023
1 parent 6d1c611 commit 1602a9c
Show file tree
Hide file tree
Showing 11 changed files with 751 additions and 289 deletions.
3 changes: 0 additions & 3 deletions .eslintrc.json

This file was deleted.

29 changes: 23 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
{
// 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": true,
"source.organizeImports": false
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},

// The following is optional.
// It's better to put under project setting `.vscode/settings.json`
// to avoid conflicts with working with different eslint configs
// that does not support all formats.
// Silent the stylistic rules in you IDE, but still auto fix them
"eslint.rules.customizations": [
{ "rule": "style/*", "severity": "off" },
{ "rule": "prettier/*", "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",
Expand Down
12 changes: 6 additions & 6 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ pnpm add @vue/composition-api
#### 注册为全局组件

```ts
import { createApp } from "vue";
import CodeDiff from "v-code-diff";
import { createApp } from 'vue'
import CodeDiff from 'v-code-diff'

app.use(CodeDiff).mount("#app");
app.use(CodeDiff).mount('#app')
```

然后
Expand All @@ -88,10 +88,10 @@ app.use(CodeDiff).mount("#app");
#### 注册为全局组件

```ts
import Vue from "vue";
import CodeDiff from "v-code-diff";
import Vue from 'vue'
import CodeDiff from 'v-code-diff'

Vue.use(CodeDiff);
Vue.use(CodeDiff)
```

#### 单独引入
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ yarn add v-code-diff
pnpm add v-code-diff
```

Vue2 developers need install composition-api
Vue2.6 developers need install composition-api

```shell
pnpm add @vue/composition-api
Expand Down
10 changes: 6 additions & 4 deletions env.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/// <reference types="vite/client" />

declare module '*.vue' {
import type { DefineComponent } from 'vue'
const component: DefineComponent<{}, {}, any>
export default component
}
import type { DefineComponent } from 'vue'

// eslint-disable-next-line
const component: DefineComponent<{}, {}, any>
export default component
}
5 changes: 5 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import antfu from '@antfu/eslint-config'

export default antfu({
ignores: ['dist', '**/dist/**', 'node_modules', '**/node_modules/**'],
})
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
{
"name": "v-code-diff",
"type": "module",
"version": "1.8.0",
"description": "template component for vue-demi, can dev and build",
"exports": {
".": {
"types": "./types/index.d.ts",
"require": "./dist/index.cjs.js",
"import": "./dist/index.es.js"
"import": "./dist/index.es.js",
"require": "./dist/index.cjs.js"
}
},
"main": "dist/index.cjs",
"module": "dist/index.es.js",
"types": "./types/index.d.ts",
"files": [
"scripts",
"LICENSE",
"dist",
"scripts",
"src",
"types",
"LICENSE"
"types"
],
"scripts": {
"build": "npm run clean && run-s build:**",
Expand Down Expand Up @@ -55,10 +56,11 @@
"vue-demi": "^0.14.6"
},
"devDependencies": {
"@antfu/eslint-config": "^0.39.8",
"@antfu/eslint-config": "^2.4.5",
"@types/diff": "^5.0.0",
"@types/diff-match-patch": "^1.0.32",
"@types/node": "^18.11.18",
"@unocss/eslint-plugin": "^0.58.0",
"@vueuse/core": "^10.7.0",
"bumpp": "^8.2.1",
"eslint": "^8.55.0",
Expand Down
Loading

0 comments on commit 1602a9c

Please sign in to comment.