mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-17 13:25:24 +03:00
Migrate ESLint Configuration (#4375)
This commit is contained in:
parent
ebd15590af
commit
9f2efb2843
5 changed files with 99 additions and 53 deletions
|
@ -1,5 +0,0 @@
|
||||||
*.json
|
|
||||||
*.html
|
|
||||||
*.less
|
|
||||||
*.css
|
|
||||||
package.json
|
|
48
.eslintrc.js
48
.eslintrc.js
|
@ -1,48 +0,0 @@
|
||||||
module.exports = {
|
|
||||||
parserOptions: {
|
|
||||||
ecmaVersion: 2020,
|
|
||||||
sourceType: "module",
|
|
||||||
},
|
|
||||||
extends: ["plugin:vue/recommended", "prettier"],
|
|
||||||
env: {
|
|
||||||
node: true,
|
|
||||||
jquery: true,
|
|
||||||
es2017: true,
|
|
||||||
browser: true,
|
|
||||||
webextensions: true,
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
"no-var": "error",
|
|
||||||
"prefer-template": "error",
|
|
||||||
"comma-dangle": ["error", "always-multiline"],
|
|
||||||
indent: [
|
|
||||||
"error",
|
|
||||||
4,
|
|
||||||
{
|
|
||||||
SwitchCase: 1,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
globals: {
|
|
||||||
cordova: true,
|
|
||||||
cordovaUI: true,
|
|
||||||
ol: true,
|
|
||||||
wNumb: true,
|
|
||||||
ConfigStorage: true,
|
|
||||||
// start cordova bindings, remove after cordova is removed/replace/modularized
|
|
||||||
cordova_serial: true,
|
|
||||||
fileChooser: true,
|
|
||||||
i18n: true,
|
|
||||||
appReady: true,
|
|
||||||
cordovaChromeapi: true,
|
|
||||||
appAvailability: true,
|
|
||||||
// end cordova bindings
|
|
||||||
|
|
||||||
// globals for vite
|
|
||||||
__APP_PRODUCTNAME__: "readonly",
|
|
||||||
__APP_VERSION__: "readonly",
|
|
||||||
__APP_REVISION__: "readonly",
|
|
||||||
},
|
|
||||||
// ignore src/dist folders
|
|
||||||
ignorePatterns: ["src/dist/*"],
|
|
||||||
};
|
|
58
eslint.config.js
Normal file
58
eslint.config.js
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
import { defineConfig } from "eslint-define-config";
|
||||||
|
import vuePlugin from "eslint-plugin-vue";
|
||||||
|
import prettierPlugin from "eslint-plugin-prettier";
|
||||||
|
import vueParser from "vue-eslint-parser";
|
||||||
|
|
||||||
|
export default defineConfig([
|
||||||
|
{
|
||||||
|
files: ["**/*.js", "**/*.vue"],
|
||||||
|
languageOptions: {
|
||||||
|
ecmaVersion: "latest",
|
||||||
|
sourceType: "module",
|
||||||
|
globals: {
|
||||||
|
cordova: "readonly",
|
||||||
|
cordovaUI: "readonly",
|
||||||
|
ol: "readonly",
|
||||||
|
wNumb: "readonly",
|
||||||
|
ConfigStorage: "readonly",
|
||||||
|
// start cordova bindings, remove after cordova is removed/replace/modularized
|
||||||
|
cordova_serial: "readonly",
|
||||||
|
fileChooser: "readonly",
|
||||||
|
i18n: "readonly",
|
||||||
|
appReady: "readonly",
|
||||||
|
cordovaChromeapi: "readonly",
|
||||||
|
appAvailability: "readonly",
|
||||||
|
// end cordova bindings
|
||||||
|
|
||||||
|
// globals for vite
|
||||||
|
__APP_PRODUCTNAME__: "readonly",
|
||||||
|
__APP_VERSION__: "readonly",
|
||||||
|
__APP_REVISION__: "readonly",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
plugins: {
|
||||||
|
vue: vuePlugin,
|
||||||
|
prettier: prettierPlugin,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
"no-var": "error",
|
||||||
|
"prefer-template": "error",
|
||||||
|
"comma-dangle": ["error", "always-multiline"],
|
||||||
|
indent: [
|
||||||
|
"error",
|
||||||
|
4,
|
||||||
|
{
|
||||||
|
SwitchCase: 1,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
ignores: ["dist/", "*.json", "*.html", "*.less", "*.css", "package.json"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ["**/*.vue"],
|
||||||
|
languageOptions: {
|
||||||
|
parser: vueParser,
|
||||||
|
},
|
||||||
|
processor: "vue/vue",
|
||||||
|
},
|
||||||
|
]);
|
|
@ -4,6 +4,7 @@
|
||||||
"displayName": "Betaflight - Configuration and management tool",
|
"displayName": "Betaflight - Configuration and management tool",
|
||||||
"description": "Crossplatform configuration and management tool for the Betaflight flight control firmware.",
|
"description": "Crossplatform configuration and management tool for the Betaflight flight control firmware.",
|
||||||
"version": "11.0.0",
|
"version": "11.0.0",
|
||||||
|
"type": "module",
|
||||||
"main": "index.html",
|
"main": "index.html",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
@ -89,6 +90,8 @@
|
||||||
"del": "^8.0.0",
|
"del": "^8.0.0",
|
||||||
"eslint": "^9.21.0",
|
"eslint": "^9.21.0",
|
||||||
"eslint-config-prettier": "^10.0.2",
|
"eslint-config-prettier": "^10.0.2",
|
||||||
|
"eslint-define-config": "^2.1.0",
|
||||||
|
"eslint-plugin-prettier": "^5.2.3",
|
||||||
"eslint-plugin-vue": "^9.32.0",
|
"eslint-plugin-vue": "^9.32.0",
|
||||||
"follow-redirects": "^1.15.9",
|
"follow-redirects": "^1.15.9",
|
||||||
"fs-extra": "^11.3.0",
|
"fs-extra": "^11.3.0",
|
||||||
|
|
38
yarn.lock
38
yarn.lock
|
@ -1704,6 +1704,11 @@
|
||||||
resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33"
|
resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33"
|
||||||
integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==
|
integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==
|
||||||
|
|
||||||
|
"@pkgr/core@^0.1.0":
|
||||||
|
version "0.1.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/@pkgr/core/-/core-0.1.1.tgz#1ec17e2edbec25c8306d424ecfbf13c7de1aaa31"
|
||||||
|
integrity sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==
|
||||||
|
|
||||||
"@quanle94/innosetup@^6.0.2":
|
"@quanle94/innosetup@^6.0.2":
|
||||||
version "6.0.2"
|
version "6.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/@quanle94/innosetup/-/innosetup-6.0.2.tgz#b678b67240486302a08e3469151faca2c29f80ab"
|
resolved "https://registry.yarnpkg.com/@quanle94/innosetup/-/innosetup-6.0.2.tgz#b678b67240486302a08e3469151faca2c29f80ab"
|
||||||
|
@ -4468,6 +4473,19 @@ eslint-config-prettier@^10.0.2:
|
||||||
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-10.0.2.tgz#47444de8aa104ce82c2f91ad2a5e96b62c01e20d"
|
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-10.0.2.tgz#47444de8aa104ce82c2f91ad2a5e96b62c01e20d"
|
||||||
integrity sha512-1105/17ZIMjmCOJOPNfVdbXafLCLj3hPmkmB7dLgt7XsQ/zkxSuDerE/xgO3RxoHysR1N1whmquY0lSn2O0VLg==
|
integrity sha512-1105/17ZIMjmCOJOPNfVdbXafLCLj3hPmkmB7dLgt7XsQ/zkxSuDerE/xgO3RxoHysR1N1whmquY0lSn2O0VLg==
|
||||||
|
|
||||||
|
eslint-define-config@^2.1.0:
|
||||||
|
version "2.1.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/eslint-define-config/-/eslint-define-config-2.1.0.tgz#9708b3efd57637b6fb685d9c2fb6285b9acfbd71"
|
||||||
|
integrity sha512-QUp6pM9pjKEVannNAbSJNeRuYwW3LshejfyBBpjeMGaJjaDUpVps4C6KVR8R7dWZnD3i0synmrE36znjTkJvdQ==
|
||||||
|
|
||||||
|
eslint-plugin-prettier@^5.2.3:
|
||||||
|
version "5.2.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.3.tgz#c4af01691a6fa9905207f0fbba0d7bea0902cce5"
|
||||||
|
integrity sha512-qJ+y0FfCp/mQYQ/vWQ3s7eUlFEL4PyKfAJxsnYTJ4YT73nsJBWqmEpFryxV9OeUiqmsTsYJ5Y+KDNaeP31wrRw==
|
||||||
|
dependencies:
|
||||||
|
prettier-linter-helpers "^1.0.0"
|
||||||
|
synckit "^0.9.1"
|
||||||
|
|
||||||
eslint-plugin-vue@^9.32.0:
|
eslint-plugin-vue@^9.32.0:
|
||||||
version "9.32.0"
|
version "9.32.0"
|
||||||
resolved "https://registry.yarnpkg.com/eslint-plugin-vue/-/eslint-plugin-vue-9.32.0.tgz#2b558e827886b567dfaa156cc1cad0f596461fab"
|
resolved "https://registry.yarnpkg.com/eslint-plugin-vue/-/eslint-plugin-vue-9.32.0.tgz#2b558e827886b567dfaa156cc1cad0f596461fab"
|
||||||
|
@ -4782,6 +4800,11 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3:
|
||||||
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
|
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
|
||||||
integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==
|
integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==
|
||||||
|
|
||||||
|
fast-diff@^1.1.2:
|
||||||
|
version "1.3.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.3.0.tgz#ece407fa550a64d638536cd727e129c61616e0f0"
|
||||||
|
integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==
|
||||||
|
|
||||||
fast-fifo@^1.2.0, fast-fifo@^1.3.2:
|
fast-fifo@^1.2.0, fast-fifo@^1.3.2:
|
||||||
version "1.3.2"
|
version "1.3.2"
|
||||||
resolved "https://registry.yarnpkg.com/fast-fifo/-/fast-fifo-1.3.2.tgz#286e31de96eb96d38a97899815740ba2a4f3640c"
|
resolved "https://registry.yarnpkg.com/fast-fifo/-/fast-fifo-1.3.2.tgz#286e31de96eb96d38a97899815740ba2a4f3640c"
|
||||||
|
@ -8108,6 +8131,13 @@ prelude-ls@^1.2.1:
|
||||||
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
|
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
|
||||||
integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==
|
integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==
|
||||||
|
|
||||||
|
prettier-linter-helpers@^1.0.0:
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b"
|
||||||
|
integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==
|
||||||
|
dependencies:
|
||||||
|
fast-diff "^1.1.2"
|
||||||
|
|
||||||
prettier@^3.5.2:
|
prettier@^3.5.2:
|
||||||
version "3.5.2"
|
version "3.5.2"
|
||||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.5.2.tgz#d066c6053200da0234bf8fa1ef45168abed8b914"
|
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.5.2.tgz#d066c6053200da0234bf8fa1ef45168abed8b914"
|
||||||
|
@ -9537,6 +9567,14 @@ symbol-tree@^3.2.4:
|
||||||
resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2"
|
resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2"
|
||||||
integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==
|
integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==
|
||||||
|
|
||||||
|
synckit@^0.9.1:
|
||||||
|
version "0.9.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.9.2.tgz#a3a935eca7922d48b9e7d6c61822ee6c3ae4ec62"
|
||||||
|
integrity sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==
|
||||||
|
dependencies:
|
||||||
|
"@pkgr/core" "^0.1.0"
|
||||||
|
tslib "^2.6.2"
|
||||||
|
|
||||||
tar-stream@^1.5.2:
|
tar-stream@^1.5.2:
|
||||||
version "1.6.2"
|
version "1.6.2"
|
||||||
resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.6.2.tgz#8ea55dab37972253d9a9af90fdcd559ae435c555"
|
resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.6.2.tgz#8ea55dab37972253d9a9af90fdcd559ae435c555"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue