Skip to content

Commit c28a409

Browse files
committed
added eslint and prettier
1 parent b7495ea commit c28a409

File tree

6 files changed

+261
-14
lines changed

6 files changed

+261
-14
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
!docs/.vitepress
22
dist
33
examples
4-
src

.eslintrc.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1+
/* eslint-env node */
2+
require('@rushstack/eslint-patch/modern-module-resolution')
3+
14
module.exports = {
25
root: true,
36
env: {
47
node: true
58
},
6-
extends: [
7-
'eslint:recommended',
8-
'plugin:vue/recommended', // Use recommended rules from the plugin
9-
],
9+
extends: ['plugin:vue/recommended', 'eslint:recommended', '@vue/eslint-config-typescript/recommended', '@vue/eslint-config-prettier'],
1010
rules: {
1111
// Customize your rules here
1212
}
13-
};
13+
}

.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"printWidth": 160,
3+
"semi": false,
4+
"singleQuote": true,
5+
"arrowParens": "always",
6+
"trailingComma": "none",
7+
"singleAttributePerLine": true
8+
}

package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,16 @@
2828
"push": "clear && git config core.ignorecase false && branch=\"$(git symbolic-ref -q HEAD)\" || \"dev\" && branch=${branch##refs/heads/} && branch=${branch:-HEAD} && echo Pushing to Branch \"$branch\" && echo Please type your commit message && read msg && clear && git add . && git commit -m \"$msg\" && git push origin \"$branch\""
2929
},
3030
"devDependencies": {
31+
"@rushstack/eslint-patch": "^1.2.0",
32+
"@typescript-eslint/eslint-plugin": "^5.38.1",
33+
"@typescript-eslint/parser": "^5.38.1",
3134
"@rollup/plugin-node-resolve": "^15.0.1",
35+
"@vue/eslint-config-prettier": "^7.0.0",
36+
"@vue/eslint-config-typescript": "^11.0.2",
37+
"prettier": "^2.7.1",
38+
"rimraf": "^3.0.2",
3239
"eslint": "^8.34.0",
40+
"eslint-config-prettier": "^8.5.0",
3341
"eslint-plugin-vue": "^9.9.0",
3442
"lint-staged": "^13.1.2",
3543
"rollup": "^2.6.1",

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ import NumberFormat from './number-format'
66
export { component, directive, options, NumberFormat }
77

88
export default {
9-
install(app: any, config?: Config) {
9+
install(Vue: any, config?: Config) {
1010
if (config) {
1111
Object.assign(options, config)
1212
}
13-
app.directive('number', directive)
14-
app.component('VueNumber', component)
13+
Vue.directive('number', directive)
14+
Vue.component('VueNumber', component)
1515
}
1616
}

0 commit comments

Comments
 (0)