mirror of
https://git.proxmox.com/git/pve-eslint
synced 2025-10-04 06:27:57 +00:00
ship an example config and extend-rules sample files
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
d4b999a4ce
commit
551ca188fd
1
debian/pve-eslint.docs
vendored
Normal file
1
debian/pve-eslint.docs
vendored
Normal file
@ -0,0 +1 @@
|
||||
examples
|
18
src/examples/extend-rules-cfg.json
Normal file
18
src/examples/extend-rules-cfg.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"rules": {
|
||||
"comma-dangle": ["warn", "always-multiline"],
|
||||
"no-irregular-whitespace": "error",
|
||||
"array-bracket-spacing": ["warn", "never"],
|
||||
"object-curly-spacing": ["warn", "always"],
|
||||
"no-unused-vars": ["warn", {
|
||||
"vars": "all",
|
||||
"args": "none",
|
||||
"varsIgnorePattern": "^(me|_.*)$"
|
||||
}],
|
||||
"no-undef": "error",
|
||||
"semi": "warn",
|
||||
"semi-spacing": "warn",
|
||||
"semi-style": "warn",
|
||||
"no-extra-semi": "warn"
|
||||
}
|
||||
}
|
21
src/examples/extend-rules-cfg.yaml
Normal file
21
src/examples/extend-rules-cfg.yaml
Normal file
@ -0,0 +1,21 @@
|
||||
rules:
|
||||
array-bracket-spacing:
|
||||
- warn
|
||||
- never
|
||||
comma-dangle:
|
||||
- warn
|
||||
- always-multiline
|
||||
no-extra-semi: warn
|
||||
no-irregular-whitespace: error
|
||||
no-undef: error
|
||||
no-unused-vars:
|
||||
- warn
|
||||
- args: none
|
||||
vars: all
|
||||
varsIgnorePattern: ^(me|_.*)$
|
||||
object-curly-spacing:
|
||||
- warn
|
||||
- always
|
||||
semi: warn
|
||||
semi-spacing: warn
|
||||
semi-style: warn
|
303
src/examples/full-config.json
Normal file
303
src/examples/full-config.json
Normal file
@ -0,0 +1,303 @@
|
||||
{
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2017,
|
||||
"ecmaFeatures": {
|
||||
"impliedStrict": true
|
||||
}
|
||||
},
|
||||
"env": {
|
||||
"browser": true,
|
||||
"node": true,
|
||||
"es2017": true
|
||||
},
|
||||
"globals": {
|
||||
"Ext": "writable",
|
||||
"FormData": "writable",
|
||||
"PBS": "writable",
|
||||
"PMG": "writable",
|
||||
"PVE": "writable",
|
||||
"PVE_vnc_console_event": "writable",
|
||||
"Proxmox": "writable",
|
||||
"console": "writable",
|
||||
"eslint": "writable",
|
||||
"gettext": "writable",
|
||||
"proxmoxOnlineHelpInfo": "writable",
|
||||
"pveOnlineHelpInfo": "writable"
|
||||
},
|
||||
"rules": {
|
||||
"constructor-super": "error",
|
||||
"for-direction": "error",
|
||||
"getter-return": "error",
|
||||
"no-async-promise-executor": "error",
|
||||
"no-case-declarations": "error",
|
||||
"no-class-assign": "error",
|
||||
"no-compare-neg-zero": "error",
|
||||
"no-cond-assign": "error",
|
||||
"no-const-assign": "error",
|
||||
"no-constant-condition": "error",
|
||||
"no-control-regex": "error",
|
||||
"no-debugger": "error",
|
||||
"no-delete-var": "error",
|
||||
"no-dupe-args": "error",
|
||||
"no-dupe-class-members": "error",
|
||||
"no-dupe-else-if": "error",
|
||||
"no-dupe-keys": "error",
|
||||
"no-duplicate-case": "error",
|
||||
"no-empty": "error",
|
||||
"no-empty-character-class": "error",
|
||||
"no-empty-pattern": "error",
|
||||
"no-ex-assign": "error",
|
||||
"no-extra-boolean-cast": "error",
|
||||
"no-extra-semi": "error",
|
||||
"no-fallthrough": "error",
|
||||
"no-func-assign": "error",
|
||||
"no-global-assign": "error",
|
||||
"no-import-assign": "error",
|
||||
"no-inner-declarations": "error",
|
||||
"no-invalid-regexp": "error",
|
||||
"no-irregular-whitespace": "error",
|
||||
"no-misleading-character-class": "error",
|
||||
"no-mixed-spaces-and-tabs": [
|
||||
"error",
|
||||
"smart-tabs"
|
||||
],
|
||||
"no-new-symbol": "error",
|
||||
"no-obj-calls": "error",
|
||||
"no-octal": "error",
|
||||
"no-prototype-builtins": "error",
|
||||
"no-redeclare": "error",
|
||||
"no-regex-spaces": "error",
|
||||
"no-self-assign": "error",
|
||||
"no-setter-return": "error",
|
||||
"no-shadow-restricted-names": "error",
|
||||
"no-sparse-arrays": "error",
|
||||
"no-this-before-super": "error",
|
||||
"no-undef": "error",
|
||||
"no-unexpected-multiline": "error",
|
||||
"no-unreachable": "error",
|
||||
"no-unsafe-finally": "error",
|
||||
"no-unsafe-negation": "error",
|
||||
"no-unused-labels": "error",
|
||||
"no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
"vars": "all",
|
||||
"args": "none",
|
||||
"varsIgnorePattern": "^(me|_.*)$"
|
||||
}
|
||||
],
|
||||
"no-useless-catch": "error",
|
||||
"no-useless-escape": "error",
|
||||
"no-with": "error",
|
||||
"require-yield": "error",
|
||||
"use-isnan": "error",
|
||||
"valid-typeof": "error",
|
||||
"accessor-pairs": "error",
|
||||
"array-callback-return": "error",
|
||||
"block-scoped-var": "error",
|
||||
"consistent-return": "error",
|
||||
"curly": [
|
||||
"error",
|
||||
"multi-line"
|
||||
],
|
||||
"dot-location": [
|
||||
"error",
|
||||
"property"
|
||||
],
|
||||
"dot-notation": "error",
|
||||
"eqeqeq": "error",
|
||||
"grouped-accessor-pairs": "error",
|
||||
"guard-for-in": "error",
|
||||
"no-alert": "error",
|
||||
"no-await-in-loop": "error",
|
||||
"no-caller": "error",
|
||||
"no-constructor-return": "error",
|
||||
"no-div-regex": "error",
|
||||
"no-empty-function": "error",
|
||||
"no-eq-null": "error",
|
||||
"no-eval": "error",
|
||||
"no-extend-native": "error",
|
||||
"no-extra-bind": "error",
|
||||
"no-extra-label": "error",
|
||||
"no-extra-parens": [
|
||||
"error",
|
||||
"all",
|
||||
{
|
||||
"conditionalAssign": false,
|
||||
"enforceForArrowConditionals": false,
|
||||
"nestedBinaryExpressions": false
|
||||
}
|
||||
],
|
||||
"no-floating-decimal": "error",
|
||||
"no-implicit-coercion": [
|
||||
"error",
|
||||
{
|
||||
"allow": [
|
||||
"!!"
|
||||
]
|
||||
}
|
||||
],
|
||||
"no-implicit-globals": "error",
|
||||
"no-implied-eval": "error",
|
||||
"no-invalid-this": "error",
|
||||
"no-lone-blocks": "error",
|
||||
"no-loop-func": "error",
|
||||
"no-multi-spaces": "error",
|
||||
"no-multi-str": "error",
|
||||
"no-new": "error",
|
||||
"no-new-func": "error",
|
||||
"no-new-wrappers": "error",
|
||||
"no-octal-escape": "error",
|
||||
"no-proto": "error",
|
||||
"no-return-assign": "error",
|
||||
"no-return-await": "error",
|
||||
"no-script-url": "error",
|
||||
"no-self-compare": "error",
|
||||
"no-sequences": "error",
|
||||
"no-template-curly-in-string": "error",
|
||||
"no-unmodified-loop-condition": "error",
|
||||
"no-unused-expressions": "error",
|
||||
"no-useless-call": "error",
|
||||
"no-useless-concat": "error",
|
||||
"no-useless-return": "error",
|
||||
"no-void": "error",
|
||||
"prefer-regex-literals": "error",
|
||||
"radix": "error",
|
||||
"require-atomic-updates": "error",
|
||||
"wrap-iife": "error",
|
||||
"yoda": "error",
|
||||
"no-label-var": "error",
|
||||
"no-shadow": "error",
|
||||
"no-undef-init": "error",
|
||||
"no-use-before-define": "error",
|
||||
"array-bracket-spacing": [
|
||||
"warn",
|
||||
"never"
|
||||
],
|
||||
"brace-style": [
|
||||
"warn",
|
||||
"1tbs",
|
||||
{
|
||||
"allowSingleLine": true
|
||||
}
|
||||
],
|
||||
"comma-dangle": [
|
||||
"warn",
|
||||
"always-multiline"
|
||||
],
|
||||
"comma-spacing": "warn",
|
||||
"comma-style": "warn",
|
||||
"computed-property-spacing": "warn",
|
||||
"consistent-this": [
|
||||
"warn",
|
||||
"me"
|
||||
],
|
||||
"eol-last": "warn",
|
||||
"func-call-spacing": "warn",
|
||||
"func-name-matching": "warn",
|
||||
"func-style": "warn",
|
||||
"key-spacing": "warn",
|
||||
"keyword-spacing": "warn",
|
||||
"linebreak-style": "warn",
|
||||
"max-len": [
|
||||
"warn",
|
||||
{
|
||||
"code": 110,
|
||||
"tabWidth": 8,
|
||||
"ignoreComments": true,
|
||||
"ignoreStrings": true,
|
||||
"ignoreRegExpLiterals": true
|
||||
}
|
||||
],
|
||||
"no-array-constructor": "warn",
|
||||
"no-lonely-if": "warn",
|
||||
"no-mixed-operators": [
|
||||
"warn",
|
||||
{
|
||||
"groups": [
|
||||
[
|
||||
"&",
|
||||
"|",
|
||||
"^",
|
||||
"~",
|
||||
"<<",
|
||||
">>",
|
||||
">>>"
|
||||
],
|
||||
[
|
||||
"==",
|
||||
"!=",
|
||||
"===",
|
||||
"!==",
|
||||
">",
|
||||
">=",
|
||||
"<",
|
||||
"<="
|
||||
],
|
||||
[
|
||||
"&&",
|
||||
"||"
|
||||
],
|
||||
[
|
||||
"in",
|
||||
"instanceof"
|
||||
]
|
||||
],
|
||||
"allowSamePrecedence": true
|
||||
}
|
||||
],
|
||||
"no-multiple-empty-lines": "warn",
|
||||
"no-trailing-spaces": "warn",
|
||||
"no-unneeded-ternary": "warn",
|
||||
"no-whitespace-before-property": "warn",
|
||||
"object-curly-newline": [
|
||||
"warn",
|
||||
{
|
||||
"multiline": true,
|
||||
"consistent": true
|
||||
}
|
||||
],
|
||||
"object-curly-spacing": [
|
||||
"warn",
|
||||
"always"
|
||||
],
|
||||
"operator-linebreak": [
|
||||
"warn",
|
||||
"after",
|
||||
{
|
||||
"overrides": {
|
||||
"?": "before",
|
||||
":": "before",
|
||||
"+": "ignore"
|
||||
}
|
||||
}
|
||||
],
|
||||
"padded-blocks": [
|
||||
"warn",
|
||||
"never"
|
||||
],
|
||||
"quote-props": [
|
||||
"warn",
|
||||
"as-needed",
|
||||
{
|
||||
"keywords": true,
|
||||
"unnecessary": false
|
||||
}
|
||||
],
|
||||
"semi": "warn",
|
||||
"semi-spacing": "warn",
|
||||
"space-before-blocks": "warn",
|
||||
"space-before-function-paren": [
|
||||
"warn",
|
||||
"never"
|
||||
],
|
||||
"space-in-parens": "warn",
|
||||
"space-unary-ops": "warn",
|
||||
"switch-colon-spacing": "warn",
|
||||
"unicode-bom": "warn",
|
||||
"arrow-body-style": "warn",
|
||||
"arrow-spacing": "warn",
|
||||
"prefer-numeric-literals": "warn",
|
||||
"template-curly-spacing": "warn"
|
||||
}
|
||||
}
|
106
src/examples/reduced-config.json
Normal file
106
src/examples/reduced-config.json
Normal file
@ -0,0 +1,106 @@
|
||||
{
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2017,
|
||||
"ecmaFeatures": {
|
||||
"impliedStrict": true
|
||||
}
|
||||
},
|
||||
"env": {
|
||||
"browser": true,
|
||||
"node": true,
|
||||
"es2017": true
|
||||
},
|
||||
"globals": {
|
||||
"Ext": "writable",
|
||||
"FormData": "writable",
|
||||
"PBS": "writable",
|
||||
"PMG": "writable",
|
||||
"PVE": "writable",
|
||||
"PVE_vnc_console_event": "writable",
|
||||
"Proxmox": "writable",
|
||||
"console": "writable",
|
||||
"eslint": "writable",
|
||||
"gettext": "writable"
|
||||
},
|
||||
"rules": {
|
||||
"no-redeclare": "error",
|
||||
"no-self-assign": "error",
|
||||
"no-shadow-restricted-names": "error",
|
||||
"no-undef": "error",
|
||||
"no-unreachable": "error",
|
||||
"no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
"vars": "all",
|
||||
"args": "none",
|
||||
"varsIgnorePattern": "^(me|_.*)$"
|
||||
}
|
||||
],
|
||||
"block-scoped-var": "error",
|
||||
"dot-notation": "error",
|
||||
"eqeqeq": "error",
|
||||
"no-eval": "error",
|
||||
"no-multi-spaces": "error",
|
||||
"no-self-compare": "error",
|
||||
"no-shadow": "error",
|
||||
"array-bracket-spacing": [
|
||||
"warn",
|
||||
"never"
|
||||
],
|
||||
"brace-style": [
|
||||
"warn",
|
||||
"1tbs",
|
||||
{
|
||||
"allowSingleLine": true
|
||||
}
|
||||
],
|
||||
"comma-dangle": [
|
||||
"warn",
|
||||
"always-multiline"
|
||||
],
|
||||
"comma-spacing": "warn",
|
||||
"comma-style": "warn",
|
||||
"computed-property-spacing": "warn",
|
||||
"eol-last": "warn",
|
||||
"func-call-spacing": "warn",
|
||||
"func-name-matching": "warn",
|
||||
"func-style": "warn",
|
||||
"key-spacing": "warn",
|
||||
"keyword-spacing": "warn",
|
||||
"linebreak-style": "warn",
|
||||
"no-trailing-spaces": "warn",
|
||||
"no-unneeded-ternary": "warn",
|
||||
"no-whitespace-before-property": "warn",
|
||||
"object-curly-spacing": [
|
||||
"warn",
|
||||
"always"
|
||||
],
|
||||
"padded-blocks": [
|
||||
"warn",
|
||||
"never"
|
||||
],
|
||||
"quote-props": [
|
||||
"warn",
|
||||
"as-needed",
|
||||
{
|
||||
"keywords": true,
|
||||
"unnecessary": false
|
||||
}
|
||||
],
|
||||
"semi": "warn",
|
||||
"semi-spacing": "warn",
|
||||
"space-before-blocks": "warn",
|
||||
"space-before-function-paren": [
|
||||
"warn",
|
||||
"never"
|
||||
],
|
||||
"space-in-parens": "warn",
|
||||
"space-unary-ops": "warn",
|
||||
"switch-colon-spacing": "warn",
|
||||
"unicode-bom": "warn",
|
||||
"arrow-body-style": "warn",
|
||||
"arrow-spacing": "warn",
|
||||
"prefer-numeric-literals": "warn",
|
||||
"template-curly-spacing": "warn"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user