mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-13 03:19:56 +03:00
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 <mark@numloq.nl>
This commit is contained in:
parent
0684d0e4a5
commit
937564aafe
11 changed files with 5701 additions and 1210 deletions
|
@ -7,6 +7,7 @@ end_of_line = lf
|
|||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
max_line_length = 120
|
||||
|
||||
[*.{yml,yaml}]
|
||||
indent_size = 2
|
||||
|
|
5
.eslintignore
Normal file
5
.eslintignore
Normal file
|
@ -0,0 +1,5 @@
|
|||
*.json
|
||||
*.html
|
||||
*.less
|
||||
*.css
|
||||
package.json
|
18
.eslintrc.js
18
.eslintrc.js
|
@ -3,7 +3,7 @@ module.exports = {
|
|||
ecmaVersion: 2020,
|
||||
sourceType: "module",
|
||||
},
|
||||
extends: ["plugin:vue/recommended"],
|
||||
extends: ["plugin:vue/recommended", "prettier"],
|
||||
env: {
|
||||
node: true,
|
||||
jquery: true,
|
||||
|
@ -12,16 +12,16 @@ module.exports = {
|
|||
webextensions: true,
|
||||
},
|
||||
rules: {
|
||||
"no-trailing-spaces": "error",
|
||||
"eol-last": "error",
|
||||
semi: "error",
|
||||
"no-extra-semi": "error",
|
||||
"comma-dangle": ["error", "always-multiline"],
|
||||
"no-var": "error",
|
||||
"prefer-template": "error",
|
||||
"template-curly-spacing": "error",
|
||||
"no-undef": "error",
|
||||
'no-duplicate-imports': 'error',
|
||||
"comma-dangle": ["error", "always-multiline"],
|
||||
indent: [
|
||||
"error",
|
||||
4,
|
||||
{
|
||||
SwitchCase: 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
globals: {
|
||||
cordova: true,
|
||||
|
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -21,7 +21,7 @@ cordova/bundle.keystore
|
|||
|
||||
# artefacts for Visual Studio Code
|
||||
.vscode/*
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
|
||||
# NetBeans
|
||||
nbproject/
|
||||
|
|
4
.husky/pre-commit
Executable file
4
.husky/pre-commit
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
npx lint-staged
|
7
.lintstagedrc.json
Normal file
7
.lintstagedrc.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"**/*.{js,vue}": [
|
||||
"prettier --write --ignore-unknown",
|
||||
"eslint --fix --ext .js,.vue"
|
||||
],
|
||||
"**/*.{less,css}": ["prettier --write --ignore-unknown"]
|
||||
}
|
34
.prettierignore
Normal file
34
.prettierignore
Normal file
|
@ -0,0 +1,34 @@
|
|||
# node.js npm related
|
||||
|
||||
node_modules/
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Configurator Build process
|
||||
cache/
|
||||
apps/
|
||||
dist/
|
||||
dist_cordova/
|
||||
debug/
|
||||
release/
|
||||
testresults/
|
||||
.eslintcache
|
||||
cordova/bundle.keystore
|
||||
|
||||
# OSX
|
||||
.DS_store
|
||||
|
||||
# artefacts for Visual Studio Code
|
||||
/.vscode/
|
||||
|
||||
# NetBeans
|
||||
nbproject/
|
||||
|
||||
# IntelliJ
|
||||
.idea
|
||||
|
||||
# Eclipse
|
||||
.project
|
||||
.settings/
|
||||
test-results-junit/
|
1
.prettierrc.json
Normal file
1
.prettierrc.json
Normal file
|
@ -0,0 +1 @@
|
|||
{}
|
5
.vscode/extensions.json
vendored
Normal file
5
.vscode/extensions.json
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"recommendations": [
|
||||
"esbenp.prettier-vscode"
|
||||
]
|
||||
}
|
51
package.json
51
package.json
|
@ -13,11 +13,20 @@
|
|||
"pretest": "yarn run lint",
|
||||
"test": "vitest",
|
||||
"lint": "eslint --ext .js,.vue src",
|
||||
"lint:fix": "eslint --fix src",
|
||||
"storybook": "start-storybook -p 6006",
|
||||
"lint:fix": "eslint --ext .js,.vue src --fix",
|
||||
"android:dev": "node capacitor.config.generator.mjs --dev && npx cap run android",
|
||||
"android:open": "vite build && node capacitor.config.generator.mjs && npx cap open android",
|
||||
"android:run": "vite build && node capacitor.config.generator.mjs && npx cap run android"
|
||||
"android:run": "vite build && node capacitor.config.generator.mjs && npx cap run android",
|
||||
"format": "prettier --write {src,test}/**/*.{js,vue,css,less}",
|
||||
"storybook": "start-storybook -p 6006",
|
||||
"prepare": "husky install"
|
||||
},
|
||||
"window": {
|
||||
"icon": "images/bf_icon_128.png",
|
||||
"id": "main-window",
|
||||
"min_width": 1024,
|
||||
"min_height": 550,
|
||||
"title": "Betaflight Configurator"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -70,10 +79,42 @@
|
|||
"babel-loader": "^8.3.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-plugin-vue": "^7.20.0",
|
||||
"husky": "^4.3.8",
|
||||
"inquirer": "^9.3.1",
|
||||
"less": "^4.2.0",
|
||||
"rollup-plugin-copy": "^3.5.0",
|
||||
"@quanle94/innosetup": "^6.0.2",
|
||||
"@rollup/plugin-alias": "^4.0.2",
|
||||
"@rollup/plugin-commonjs": "^24.0.0",
|
||||
"@rollup/plugin-node-resolve": "^15.0.1",
|
||||
"@rollup/plugin-replace": "^5.0.2",
|
||||
"command-exists": "^1.2.9",
|
||||
"cordova-lib": "^11.0.0",
|
||||
"del": "^6.1.1",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"follow-redirects": "^1.15.2",
|
||||
"fs-extra": "^10.1.0",
|
||||
"glob": "^8.0.3",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-debian": "^0.3.2",
|
||||
"gulp-json-editor": "^2.5.6",
|
||||
"gulp-less": "^5.0.0",
|
||||
"gulp-prompt": "^1.2.0",
|
||||
"gulp-rename": "^2.0.0",
|
||||
"gulp-replace": "^1.1.3",
|
||||
"gulp-sourcemaps": "^3.0.0",
|
||||
"gulp-util": "^3.0.8",
|
||||
"gulp-xml-transformer": "^5.1.1",
|
||||
"gulp-yarn": "^3.0.0",
|
||||
"gulp-zip": "^5.1.0",
|
||||
"husky": "^8.0.2",
|
||||
"lint-staged": "^13.1.0",
|
||||
"nw-builder": "^3.8.6",
|
||||
"os": "^0.1.2",
|
||||
"postcss": "^8.4.17",
|
||||
"prettier": "2.8.1",
|
||||
"rollup": "^3.9.0",
|
||||
"rollup-plugin-vue": "^5.*.*",
|
||||
"rpm-builder": "^1.2.1",
|
||||
"run-script-os": "^1.1.6",
|
||||
"vite": "^4.5.3",
|
||||
"vitest": "^0.27.3",
|
||||
|
@ -90,4 +131,4 @@
|
|||
"pre-commit": "yarn lint"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue