Skip to content

Commit 9a4301e

Browse files
committed
ci: update eslint and prettier
1 parent 59f2a8d commit 9a4301e

File tree

5 files changed

+78
-33
lines changed

5 files changed

+78
-33
lines changed

.eslintrc.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,21 @@ module.exports = {
33
browser: true,
44
es2021: true,
55
},
6-
extends: [
7-
"plugin:vue/vue3-recommended",
8-
// 'prettier',
9-
// 'plugin:prettier/recommended'
10-
],
6+
extends: ['prettier', 'plugin:prettier/recommended'],
117
parserOptions: {
12-
ecmaVersion: "latest",
13-
sourceType: "module",
8+
ecmaVersion: 'latest',
9+
sourceType: 'module',
1410
},
11+
rules: {
12+
'vue/no-v-html': 'off',
13+
'vue/require-explicit-emits': 'off',
14+
'vue/require-prop-types': 'off',
15+
'vue/require-default-prop': 'off',
16+
'vue/no-reserved-keys': 'off',
17+
'vue/comment-directive': 'off',
18+
'vue/prop-name-casing': 'off',
19+
'vue/one-component-per-file': 'off',
20+
'vue/custom-event-name-casing': 'off',
21+
'vue/v-on-event-hyphenation': 'off',
22+
}
1523
};

.prettierignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
**/*.png
2+
**/*.svg
3+
CODEOWNERS
4+
.dockerignore
5+
Dockerfile.ui-test
6+
package.json
7+
.dumi/tmp
8+
.dumi/tmp-production
9+
AUTHORS.txt
10+
lib/
11+
es/
12+
dist/
13+
_site/
14+
server
15+
.dumi/tmp
16+
coverage/
17+
CNAME
18+
LICENSE
19+
yarn.lock
20+
netlify.toml
21+
yarn-error.log
22+
*.sh
23+
*.snap
24+
components/*/*.js
25+
components/*/*.jsx
26+
.gitignore
27+
.npmignore
28+
.prettierignore
29+
.DS_Store
30+
.editorconfig
31+
.eslintignore
32+
.history
33+
.eslintrc.js
34+
**/*.yml

.prettierrc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
{
22
"singleQuote": true,
33
"trailingComma": "all",
4-
"endOfLine": "lf",
54
"printWidth": 100,
65
"proseWrap": "never",
7-
"arrowParens": "avoid",
8-
"htmlWhitespaceSensitivity": "ignore",
96
"overrides": [
107
{
118
"files": ".prettierrc",

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "vue-lazy-load-image-component",
3-
"version": "0.0.6",
3+
"version": "0.0.7",
44
"description": "vue-lazy-load-image-component",
5-
"main": "lib/index.js",
5+
"main": "lib/index.es.js",
66
"exports": {
7-
".": "./lib/index.js",
8-
"./lib/style.css": "./lib/style.css"
7+
".": "./lib/index.es.js",
8+
"./lib/index.css": "./lib/index.css"
99
},
1010
"types": "./lib/index.d.ts",
1111
"scripts": {
@@ -16,6 +16,7 @@
1616
"prepare": "husky install",
1717
"lint-staged": "lint-staged --allow-empty",
1818
"lint-staged:js": "eslint --ext .js,.jsx,.ts,.tsx ",
19+
"prettier": "prettier -c --write **/*",
1920
"release": "standard-version"
2021
},
2122
"lint-staged": {

vite.config.ts

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
/// <reference types="vitest" />
2-
import { defineConfig } from 'vite'
3-
import dts from 'vite-plugin-dts'
4-
import vueJsx from '@vitejs/plugin-vue-jsx'
2+
import { defineConfig } from 'vite';
3+
import dts from 'vite-plugin-dts';
4+
import vueJsx from '@vitejs/plugin-vue-jsx';
55
// https://vitejs.dev/config/
66
export default defineConfig({
7-
plugins: [dts({
8-
insertTypesEntry: true,
9-
cleanVueFileName: true,
10-
outputDir: 'lib',
11-
staticImport: true,
12-
exclude: ['**/__tests__/**/*', '**/__mocks__/**/*'],
13-
}), vueJsx()],
7+
plugins: [
8+
dts({
9+
insertTypesEntry: true,
10+
cleanVueFileName: true,
11+
outputDir: 'lib',
12+
staticImport: true,
13+
exclude: ['**/__tests__/**/*', '**/__mocks__/**/*'],
14+
}),
15+
vueJsx(),
16+
],
1417

1518
test: {
1619
globals: true,
@@ -19,25 +22,27 @@ export default defineConfig({
1922
web: [/.[tj]sx$/],
2023
},
2124
},
22-
25+
2326
build: {
2427
lib: {
25-
entry: 'src/index.ts',
28+
entry: ['src/index.ts'],
2629
name: 'vue-lazy-load-image-component',
27-
fileName: 'index',
30+
fileName: (format) => `index.${format}.js`,
2831
formats: ['es'],
2932
},
3033

3134
rollupOptions: {
32-
input: ['src/index.ts', 'src/effects/index.css'],
35+
// input: ['src/index.ts']
36+
input: { index: 'src/index.ts' },
3337
external: ['vue'],
3438
output: {
3539
dir: 'lib',
3640
globals: {
37-
vue: 'Vue'
41+
vue: 'Vue',
3842
},
39-
format: 'es'
40-
}
41-
}
43+
format: 'es',
44+
assetFileNames: 'index.[ext]',
45+
},
46+
},
4247
},
43-
})
48+
});

0 commit comments

Comments
 (0)