Skip to content

Commit 937564a

Browse files
formatting setup (#3196)
* formatting setup * add pre-commit hooks to lint stage files * prettier setup * eslint setup * Remove yarn.lock again * Reapply yarn.lock * backtracking * Updated yarn.lock again --------- Co-authored-by: Mark Haslinghuis <[email protected]>
1 parent 0684d0e commit 937564a

11 files changed

+5712
-1221
lines changed

.editorconfig

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ end_of_line = lf
77
charset = utf-8
88
trim_trailing_whitespace = true
99
insert_final_newline = true
10+
max_line_length = 120
1011

1112
[*.{yml,yaml}]
1213
indent_size = 2

.eslintignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.json
2+
*.html
3+
*.less
4+
*.css
5+
package.json

.eslintrc.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module.exports = {
33
ecmaVersion: 2020,
44
sourceType: "module",
55
},
6-
extends: ["plugin:vue/recommended"],
6+
extends: ["plugin:vue/recommended", "prettier"],
77
env: {
88
node: true,
99
jquery: true,
@@ -12,16 +12,16 @@ module.exports = {
1212
webextensions: true,
1313
},
1414
rules: {
15-
"no-trailing-spaces": "error",
16-
"eol-last": "error",
17-
semi: "error",
18-
"no-extra-semi": "error",
19-
"comma-dangle": ["error", "always-multiline"],
2015
"no-var": "error",
2116
"prefer-template": "error",
22-
"template-curly-spacing": "error",
23-
"no-undef": "error",
24-
'no-duplicate-imports': 'error',
17+
"comma-dangle": ["error", "always-multiline"],
18+
indent: [
19+
"error",
20+
4,
21+
{
22+
SwitchCase: 1,
23+
},
24+
],
2525
},
2626
globals: {
2727
cordova: true,

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ cordova/bundle.keystore
2121

2222
# artefacts for Visual Studio Code
2323
.vscode/*
24-
!.vscode/launch.json
24+
!.vscode/extensions.json
2525

2626
# NetBeans
2727
nbproject/

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx lint-staged

.lintstagedrc.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"**/*.{js,vue}": [
3+
"prettier --write --ignore-unknown",
4+
"eslint --fix --ext .js,.vue"
5+
],
6+
"**/*.{less,css}": ["prettier --write --ignore-unknown"]
7+
}

.prettierignore

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# node.js npm related
2+
3+
node_modules/
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Configurator Build process
9+
cache/
10+
apps/
11+
dist/
12+
dist_cordova/
13+
debug/
14+
release/
15+
testresults/
16+
.eslintcache
17+
cordova/bundle.keystore
18+
19+
# OSX
20+
.DS_store
21+
22+
# artefacts for Visual Studio Code
23+
/.vscode/
24+
25+
# NetBeans
26+
nbproject/
27+
28+
# IntelliJ
29+
.idea
30+
31+
# Eclipse
32+
.project
33+
.settings/
34+
test-results-junit/

.prettierrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

.vscode/extensions.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"esbenp.prettier-vscode"
4+
]
5+
}

package.json

+46-5
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,20 @@
1313
"pretest": "yarn run lint",
1414
"test": "vitest",
1515
"lint": "eslint --ext .js,.vue src",
16-
"lint:fix": "eslint --fix src",
17-
"storybook": "start-storybook -p 6006",
16+
"lint:fix": "eslint --ext .js,.vue src --fix",
1817
"android:dev": "node capacitor.config.generator.mjs --dev && npx cap run android",
1918
"android:open": "vite build && node capacitor.config.generator.mjs && npx cap open android",
20-
"android:run": "vite build && node capacitor.config.generator.mjs && npx cap run android"
19+
"android:run": "vite build && node capacitor.config.generator.mjs && npx cap run android",
20+
"format": "prettier --write {src,test}/**/*.{js,vue,css,less}",
21+
"storybook": "start-storybook -p 6006",
22+
"prepare": "husky install"
23+
},
24+
"window": {
25+
"icon": "images/bf_icon_128.png",
26+
"id": "main-window",
27+
"min_width": 1024,
28+
"min_height": 550,
29+
"title": "Betaflight Configurator"
2130
},
2231
"repository": {
2332
"type": "git",
@@ -70,10 +79,42 @@
7079
"babel-loader": "^8.3.0",
7180
"eslint": "^8.57.0",
7281
"eslint-plugin-vue": "^7.20.0",
73-
"husky": "^4.3.8",
7482
"inquirer": "^9.3.1",
7583
"less": "^4.2.0",
7684
"rollup-plugin-copy": "^3.5.0",
85+
"@quanle94/innosetup": "^6.0.2",
86+
"@rollup/plugin-alias": "^4.0.2",
87+
"@rollup/plugin-commonjs": "^24.0.0",
88+
"@rollup/plugin-node-resolve": "^15.0.1",
89+
"@rollup/plugin-replace": "^5.0.2",
90+
"command-exists": "^1.2.9",
91+
"cordova-lib": "^11.0.0",
92+
"del": "^6.1.1",
93+
"eslint-config-prettier": "^8.5.0",
94+
"follow-redirects": "^1.15.2",
95+
"fs-extra": "^10.1.0",
96+
"glob": "^8.0.3",
97+
"gulp": "^4.0.2",
98+
"gulp-debian": "^0.3.2",
99+
"gulp-json-editor": "^2.5.6",
100+
"gulp-less": "^5.0.0",
101+
"gulp-prompt": "^1.2.0",
102+
"gulp-rename": "^2.0.0",
103+
"gulp-replace": "^1.1.3",
104+
"gulp-sourcemaps": "^3.0.0",
105+
"gulp-util": "^3.0.8",
106+
"gulp-xml-transformer": "^5.1.1",
107+
"gulp-yarn": "^3.0.0",
108+
"gulp-zip": "^5.1.0",
109+
"husky": "^8.0.2",
110+
"lint-staged": "^13.1.0",
111+
"nw-builder": "^3.8.6",
112+
"os": "^0.1.2",
113+
"postcss": "^8.4.17",
114+
"prettier": "2.8.1",
115+
"rollup": "^3.9.0",
116+
"rollup-plugin-vue": "^5.*.*",
117+
"rpm-builder": "^1.2.1",
77118
"run-script-os": "^1.1.6",
78119
"vite": "^4.5.3",
79120
"vitest": "^0.27.3",
@@ -90,4 +131,4 @@
90131
"pre-commit": "yarn lint"
91132
}
92133
}
93-
}
134+
}

0 commit comments

Comments
 (0)