diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000000000000000000000000000000000000..65658bddec6c4f5630c75cb0c10064d9578a558c --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +_locales +audit +icons +modules/* +!modules/internal +resources diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000000000000000000000000000000000000..f898349321b8c9b2cc9e891b9fd7d2bbbf0b1b97 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,172 @@ +{ + "env": { + "browser": true, + "es6": true, + "webextensions": true + }, + "extends": "eslint:recommended", + "globals": { + "files": true, + "helpers": true, + "HOST_PREFIX": true, + "HOST_SUFFIX": true, + "HTTP_EXPRESSION": true, + "interceptor": true, + "MAPPING_FILE_EXPRESSION": true, + "mappings": true, + "REQUEST_BLOCKING": true, + "REQUEST_HEADERS": true, + "requestAnalyzer": true, + "resources": true, + "stateManager": true, + "VALUE_SEPARATOR": true, + "VERSION_EXPRESSION": true, + "VERSION_PLACEHOLDER": true, + "WEB_DOMAIN_EXPRESSION": true, + "WEB_PREFIX_LENGTH": true, + "WEB_PREFIX_VALUE": true + }, + "overrides": { + "files": [ + "core/constants.js", + "core/files.js", + "core/mappings.js", + "core/resources.js" + ], + "rules": { + "no-unused-vars": "off" + } + }, + "rules": { + "array-bracket-newline": "error", + "array-bracket-spacing": "error", + "arrow-body-style": "error", + "arrow-parens": "error", + "arrow-spacing": "error", + "block-spacing": "error", + "brace-style": "error", + "camelcase": "error", + "comma-spacing": "error", + "comma-style": "error", + "computed-property-spacing": "error", + "consistent-this": "error", + "curly": "error", + "eol-last": "error", + "eqeqeq": "error", + "func-call-spacing": "error", + "function-paren-newline": "error", + "generator-star-spacing": "error", + "indent": [ + "error", + 4 + ], + "key-spacing": "error", + "keyword-spacing": "error", + "linebreak-style": [ + "error", + "unix" + ], + "new-cap": "error", + "new-parens": "error", + "no-array-constructor": "error", + "no-bitwise": "error", + "no-confusing-arrow": "error", + "no-continue": "error", + "no-duplicate-imports": "error", + "no-eval": "error", + "no-extend-native": "error", + "no-implicit-coercion": "error", + "no-implied-eval": "error", + "no-invalid-this": "error", + "no-iterator": "error", + "no-label-var": "error", + "no-labels": "error", + "no-lone-blocks": "error", + "no-loop-func": "error", + "no-multi-spaces": "error", + "no-multi-str": "error", + "no-multiple-empty-lines": [ + "error", { + "max": 1, + "maxEOF": 1, + "maxBOF": 0 + } + ], + "max-len": [ + "error", { + "code": 120 + } + ], + "no-negated-condition": "error", + "no-new": "error", + "no-new-func": "error", + "no-new-object": "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-shadow-restricted-names": "error", + "no-tabs": "error", + "no-ternary": "error", + "no-throw-literal": "error", + "no-trailing-spaces": "error", + "no-undef-init": "error", + "no-unmodified-loop-condition": "error", + "no-unused-expressions": "error", + "no-use-before-define": "error", + "no-useless-call": "error", + "no-useless-concat": "error", + "no-useless-constructor": "error", + "no-useless-rename": "error", + "no-useless-return": "error", + "no-void": "error", + "no-warning-comments": "warn", + "no-whitespace-before-property": "error", + "no-with": "error", + "object-curly-spacing": "error", + "object-shorthand": [ + "error", + "consistent-as-needed" + ], + "operator-assignment": "error", + "operator-linebreak": "error", + "prefer-numeric-literals": "error", + "prefer-promise-reject-errors": "error", + "quote-props": "error", + "prefer-rest-params": "error", + "prefer-spread": "error", + "prefer-template": "error", + "quotes": [ + "error", + "single" + ], + "rest-spread-spacing": "error", + "require-await": "error", + "semi": "error", + "semi-spacing": "error", + "semi-style": "error", + "space-before-blocks": "error", + "space-before-function-paren": "error", + "space-in-parens": "error", + "space-infix-ops": "error", + "space-unary-ops": "error", + "spaced-comment": "error", + "strict": [ + "error", + "global" + ], + "switch-colon-spacing": "error", + "symbol-description": "error", + "template-curly-spacing": "error", + "template-tag-spacing": "error", + "unicode-bom": "error", + "vars-on-top": "error", + "wrap-regex": "error", + "yield-star-spacing": "error", + "yoda": "error" + } +} diff --git a/audit/.eslintrc b/audit/.eslintrc new file mode 100644 index 0000000000000000000000000000000000000000..c5501dd220248c1b152bfc5562b99e0925f1c8f8 --- /dev/null +++ b/audit/.eslintrc @@ -0,0 +1,32 @@ +{ + "env": { + "es6": true, + "node": true + }, + "extends": "eslint:recommended", + "parserOptions": { + "sourceType": "module" + }, + "rules": { + "indent": [ + "error", + 4 + ], + "linebreak-style": [ + "error", + "unix" + ], + "no-console": "off", + "no-use-before-define": "error", + "operator-assignment": "error", + "prefer-template": "error", + "quotes": [ + "error", + "single" + ], + "semi": [ + "error", + "always" + ] + } +}