// 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 }, "globals": { "_": false, "$": false, "Backbone": false, "chai": false, "console": false, "jQuery": false, "loop": true, "MozActivity": false, "mozRTCSessionDescription": 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 "camelcase": 0, // TODO: Remove (use default) "computed-property-spacing": [2, "never"], "consistent-return": 0, // TODO: Remove (use default) dot-location: 0, // [2, property], "eqeqeq": 0, // TBD. Might need to be separate for content & chrome "global-strict": 0, // Leave as zero (this will be unsupported in eslint 1.0.0) "linebreak-style": [2, "unix"], "new-cap": 0, // TODO: Remove (use default) "no-catch-shadow": 0, // TODO: Remove (use default) "no-console": 0, // Leave as 0. We use console logging in content code. "no-empty": 0, // TODO: Remove (use default) "no-extra-bind": 0, // Leave as 0 "no-multi-spaces": 0, // TBD. "no-new": 0, // TODO: Remove (use default) "no-return-assign": 0, // TODO: Remove (use default) "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: Remove (use default) "no-unused-vars": 0, // TODO: Remove (use default) "no-use-before-define": 0, // TODO: Remove (use default) "object-curly-spacing": 0, // [2, "always"], "quotes": [2, "double", "avoid-escape"], "spaced-comment": [2, "always"], "strict": [2, "function"], // eslint-plugin-react rules. These are documented at // "react/jsx-quotes": [2, "double", "avoid-escape"], "react/jsx-no-undef": 2, "react/jsx-sort-props": 2, "react/jsx-sort-prop-types": 2, "react/jsx-uses-vars": 2, // Need to fix the couple of instances which don't // currently pass this rule. "react/no-did-mount-set-state": 0, "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, // We would probably want to go with a variant of never. "react/jsx-curly-spacing": 0, // 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 } }