{ "extends": "airbnb", "parser": "babel-eslint", "plugins": [ "react", "jest" ], "env": { "es6": true, "browser": true, "node": true, "jest/globals": true }, // custom rules "rules": { // http://eslint.org/docs/rules/comma-dangle // Custom rules for when trailing comma's are required "comma-dangle": ["error", { "arrays": "always-multiline", "objects": "always-multiline", "imports": "always-multiline", "exports": "always-multiline", "functions": "ignore" }], // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/extensions.md // When importing files you do not need to add file extensions for the following extensions "import/extensions": ["error", "always", { "js": "never", "jsx": "never" }], // https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md // Allowing importing from dev deps (for stories and tests) "import/no-extraneous-dependencies": "off", // http://eslint.org/docs/rules/no-plusplus // Allowing ++ on numbers "no-plusplus": "off", // http://eslint.org/docs/rules/no-param-reassign // Cannot reassign function parameters but allowing modification "no-param-reassign": ["error", { "props": false }], // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md // Allowing jsx in files with any file extension (old components have jsx but not the extension) "react/jsx-filename-extension": "off", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md // JSX props must be in alphabetical order // Disabled as this is creating too much noise in logs and is not being actively addressed "react/jsx-sort-props": "off", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unknown-property.md // This was turned off for wc - but should be re-enabled eventually "react/no-unknown-property": ["off"], // http://eslint.org/docs/rules/no-multiple-empty-lines // Disallow more than 1 empty lines "no-multiple-empty-lines": ["error", { "max": 1 }], // http://eslint.org/docs/rules/padded-blocks // Enforce no padding within blocks "padded-blocks": ["error", "never"], // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unused-prop-types.md // Adding 'skipShapeProps' as the rule has issues with correctly handling PropTypes.shape "react/no-unused-prop-types": ["error", { "skipShapeProps": true }], // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-stateless-function.md // Opt out of preferring stateless functions // Rationale: https://extranet.atlassian.com/display/AtlasKit/React+component+conventions "react/prefer-stateless-function": "off", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-default-props.md // default props not required for optional values "react/require-default-props": "off", // Disallowing the use of variables starting with `_` unless it called on `this`. // Allowed: `this._secret = Symbol()` // Not allowed: `const _secret = Symbol()` "no-underscore-dangle": ["error", { "allowAfterThis": true }], // Allowing warning and error console logging "no-console": ["error", { "allow": ["warn", "error"] }], // All blocks must be wrapped in curly braces {} // Preventing if(condition) return; // https://eslint.org/docs/rules/curly "curly": ["error", "all"], // Allowing Math.pow rather than forcing `**` // https://eslint.org/docs/rules/no-restricted-properties "no-restricted-properties": ["off", { "object": "Math", "property": "pow" }] } }