gecko-dev/browser/components/loop/.eslintrc

143 lines
4.4 KiB
Plaintext

// Note: there are extra allowances for files used solely in Firefox desktop,
// see content/js/.eslintrc and modules/.eslintrc
{
"plugins": [
"react"
],
"ecmaFeatures": {
"forOf": true,
"jsx": true,
},
"env": {
"browser": true,
"mocha": true
},
"extends": "eslint:recommended",
"globals": {
"_": false,
"Backbone": false,
"chai": false,
"console": false,
"loop": true,
"MozActivity": false,
"RTCSessionDescription": false,
"OT": false,
"performance": false,
"Promise": false,
"React": false,
"sinon": false
},
"rules": {
// turn off all kinds of stuff that we actually do want, because
// right now, we're bootstrapping the linting infrastructure. We'll
// want to audit these rules, and start turning them on and fixing the
// problems they find, one at a time.
// Eslint built-in rules are documented at <http://eslint.org/docs/rules/>
"array-bracket-spacing": [2, "never"],
"block-spacing": [2, "always"],
"callback-return": 0, // TBD
"camelcase": 0, // TODO: set to 2
"comma-spacing": 2,
"comma-style": 2,
"computed-property-spacing": [2, "never"],
"consistent-return": 2,
"curly": [2, "all"],
"dot-location": [2, "property"],
"eol-last": 2,
"eqeqeq": [2, "smart"],
"jsx-quotes": [2, "prefer-double"],
"key-spacing": [2, {"beforeColon": false, "afterColon": true }],
"linebreak-style": [2, "unix"],
"new-cap": 0, // TODO: set to 2
"new-parens": 2,
"no-alert": 2,
"no-array-constructor": 2,
"no-caller": 2,
"no-catch-shadow": 2,
"no-class-assign": 2,
"no-const-assign": 2,
"no-console": 0, // Leave as 0. We use console logging in content code.
"no-empty": 2,
"no-empty-label": 2,
"no-eval": 2,
"no-extend-native": 2, // XXX
"no-extra-bind": 0, // Leave as 0
"no-extra-parens": 0, // TODO: (bug?) [2, "functions"],
"no-extra-semi": 2,
"no-implied-eval": 2,
"no-invalid-this": 0, // TBD
"no-iterator": 2,
"no-label-var": 2,
"no-labels": 2,
"no-lone-blocks": 2,
"no-loop-func": 2,
"no-mixed-spaces-and-tabs": 2,
"no-multi-spaces": 2,
"no-multi-str": 2,
"no-multiple-empty-lines": 2,
"no-native-reassign": 2,
"no-new": 2,
"no-new-func": 2,
"no-new-object": 2,
"no-new-wrappers": 2,
"no-octal-escape": 2,
"no-process-exit": 2,
"no-proto": 2,
"no-return-assign": 2,
"no-script-url": 2,
"no-sequences": 2,
"no-shadow": 2,
"no-shadow-restricted-names": 2,
"no-spaced-func": 2,
"no-trailing-spaces": 2,
"no-undef-init": 2,
"no-underscore-dangle": 0, // Leave as 0. Commonly used for private variables.
"no-unexpected-multiline": 2,
"no-unneeded-ternary": 2,
"no-unused-expressions": 0, // TODO: Set to 2
"no-unused-vars": 0, // TODO: Set to 2
"no-use-before-define": 0, // TODO: Set to 2
"no-useless-call": 2,
"no-with": 2,
"object-curly-spacing": [2, "always"],
"operator-assignment": [2, "always"],
"quotes": [2, "double", "avoid-escape"],
"semi": 2,
"semi-spacing": [2, {"before": false, "after": true}],
"space-after-keywords": 2,
"space-before-blocks": 2,
"space-before-function-paren": [2, "never"],
"space-before-keywords": 2,
"space-infix-ops": 2,
"space-in-parens": [2, "never"],
"space-return-throw-case": 2,
"space-unary-ops": [2, {"words": true, "nonwords": false}],
"spaced-comment": [2, "always"],
"strict": [2, "function"],
"yoda": [2, "never"],
// eslint-plugin-react rules. These are documented at
// <https://github.com/yannickcr/eslint-plugin-react#list-of-supported-rules>
"react/jsx-no-undef": 2,
"react/jsx-sort-props": 2,
"react/jsx-sort-prop-types": 2,
"react/jsx-uses-vars": 2,
"react/jsx-no-duplicate-props": 2,
"react/no-did-mount-set-state": 2,
"react/no-did-update-set-state": 2,
"react/no-unknown-property": 2,
"react/prop-types": 2,
"react/self-closing-comp": 2,
"react/wrap-multilines": 2,
"react/jsx-curly-spacing": [2, "never"],
// Not worth it: React is defined globally
"react/jsx-uses-react": 0,
"react/react-in-jsx-scope": 0,
// These ones we don't want to ever enable
"react/display-name": 0,
"react/jsx-boolean-value": 0,
"react/no-danger": 0,
"react/no-multi-comp": 0
}
}