Skip to content

Commit

Permalink
fix: set the default value of include with src/**/* to prevent erro…
Browse files Browse the repository at this point in the history
…rs during build

fix #3
  • Loading branch information
gxmari007 committed Jun 10, 2021
1 parent 68f1b9b commit babe97e
Show file tree
Hide file tree
Showing 17 changed files with 1,335 additions and 1,995 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ Auto fix source code.
### `include`

- Type: `string | string[]`
- Default: `[]`
- Default: `src/**/*`

A single file, or array of files, to include when linting.

### `exclude`

- Type: `string | string[]`
- Default: `['node_modules']`
- Default: `'node_modules'`

A single file, or array of files, to exclude when linting.

Expand Down
5 changes: 0 additions & 5 deletions example/shims-vue.d.ts

This file was deleted.

1 change: 1 addition & 0 deletions example/vue/.eslintcache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"E:\\vite-plugin-eslint\\example\\vue\\src\\main.ts":"1","E:\\vite-plugin-eslint\\example\\vue\\src\\pages\\page-one.vue":"2","E:\\vite-plugin-eslint\\example\\vue\\src\\pages\\page-two.vue":"3","E:\\vite-plugin-eslint\\example\\vue\\src\\app.vue":"4"},{"size":481,"mtime":1623324752699,"results":"5","hashOfConfig":"6"},{"size":172,"mtime":1623324892492,"results":"7","hashOfConfig":"6"},{"size":172,"mtime":1623324908765,"results":"8","hashOfConfig":"6"},{"size":147,"mtime":1623313819917,"results":"9","hashOfConfig":"6"},{"filePath":"10","messages":"11","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"nk7m5f",{"filePath":"12","messages":"13","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"14","messages":"15","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"16","messages":"17","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"E:\\vite-plugin-eslint\\example\\vue\\src\\main.ts",[],"E:\\vite-plugin-eslint\\example\\vue\\src\\pages\\page-one.vue",[],"E:\\vite-plugin-eslint\\example\\vue\\src\\pages\\page-two.vue",[],"E:\\vite-plugin-eslint\\example\\vue\\src\\app.vue",[]]
5 changes: 1 addition & 4 deletions example/.eslintrc.json → example/vue/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,5 @@
"plugin:@typescript-eslint/recommended",
"prettier",
"plugin:prettier/recommended"
],
"rules": {
"vue/no-multiple-template-root": "off"
}
]
}
4 changes: 2 additions & 2 deletions example/index.html → example/vue/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>vite-plugin-eslint example</title>
<title>vite-plugin-eslint vue example</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="./main.ts"></script>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion example/package.json → example/vue/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "example",
"name": "vue-example",
"private": true,
"scripts": {
"dev": "vite",
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions example/main.ts → example/vue/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { createApp } from 'vue';
import { createRouter, createWebHistory } from 'vue-router';

import App from './app.vue';
import PageOne from './page-one.vue';
import PageOne from './pages/page-one.vue';

const router = createRouter({
history: createWebHistory(),
routes: [
{ path: '/', redirect: '/page-one' },
{ path: '/page-one', component: PageOne },
{ path: '/page-two', component: () => import('./page-two.vue') },
{ path: '/page-two', component: () => import('./pages/page-two.vue') },
],
});
const app = createApp(App);
Expand Down
4 changes: 3 additions & 1 deletion example/page-one.vue → example/vue/src/pages/page-one.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
<script lang="ts">
import { defineComponent } from 'vue';
export default defineComponent({});
export default defineComponent({
name: 'page-one',
});
</script>
4 changes: 3 additions & 1 deletion example/page-two.vue → example/vue/src/pages/page-two.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
<script lang="ts">
import { defineComponent } from 'vue';
export default defineComponent({});
export default defineComponent({
name: 'page-two',
});
</script>
9 changes: 9 additions & 0 deletions example/vue/src/shims-vue.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
declare module '*.vue' {
import { DefineComponent } from 'vue';
const component: DefineComponent<
Record<string, unknown>,
Record<string, unknown>,
unknown
>;
export default component;
}
9 changes: 1 addition & 8 deletions example/vite.config.ts → example/vue/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,5 @@ import vue from '@vitejs/plugin-vue';
import eslint from 'vite-plugin-eslint';

export default defineConfig({
plugins: [
vue(),
eslint({
cache: false,
fix: false,
include: ['./*.ts', './*.vue'],
}),
],
plugins: [vue(), eslint()],
});
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
"dist"
],
"scripts": {
"dev": "npm run build -- --watch",
"dev": "npm run build -- --watch src",
"lint": "eslint src",
"example:dev": "npm -C example run dev",
"example:build": "npm -C example run build",
"example:vue-dev": "pnpm run dev --filter vue-example",
"example:vue-build": "pnpm run build --filter vue-example",
"build": "tsup src/index.ts --dts --format esm,cjs",
"prepublishOnly": "npm run build",
"release": "standard-version"
Expand Down Expand Up @@ -47,20 +47,20 @@
"rollup": "^2.47.0"
},
"devDependencies": {
"@commitlint/cli": "^12.1.1",
"@commitlint/config-conventional": "^12.1.1",
"@types/eslint": "^7.2.10",
"@types/node": "^15.0.2",
"@typescript-eslint/eslint-plugin": "^4.22.1",
"@typescript-eslint/parser": "^4.22.1",
"@commitlint/cli": "^12.1.4",
"@commitlint/config-conventional": "^12.1.4",
"@types/eslint": "^7.2.13",
"@types/node": "^15.12.2",
"@typescript-eslint/eslint-plugin": "^4.26.1",
"@typescript-eslint/parser": "^4.26.1",
"cz-conventional-changelog": "^3.3.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0",
"husky": "4",
"prettier": "^2.2.1",
"prettier": "^2.3.1",
"standard-version": "^9.3.0",
"tsup": "^4.10.1",
"typescript": "^4.2.4",
"tsup": "^4.11.2",
"typescript": "^4.3.2",
"vite": "^2.2.4"
},
"peerDependencies": {
Expand Down
Loading

0 comments on commit babe97e

Please sign in to comment.