UNPKG

eslint-config-signavio

Version:

This package provides the agreed-upon set of JavaScript linting rules for all JavaScript projects at Signavio. The rule set is based upon the linting rules employed at [airbnb](https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb

68 lines (64 loc) 2.29 kB
const prettierConfig = require('./prettier.config') module.exports = { extends: ['airbnb', 'prettier', 'prettier/flowtype', 'prettier/react'], env: { browser: true, }, plugins: ['prettier', 'flowtype'], rules: { // `off` to allow defining internal helper // functions after the exported objects 'no-use-before-define': 'off', // `warn` in order to avoid defining all props on wrapper components 'react/prop-types': 'warn', // `off` as flow warns about using possibly undefined values 'react/require-default-props': 'off', // allow reassigning a variable in the test of a // while or do...while loop 'no-cond-assign': ['error', 'except-parens'], // `warn` to allow unfinished modules that will have multiple exports 'import/prefer-default-export': 'warn', // don't use .jsx extensions 'react/jsx-filename-extension': ['warn', { extensions: ['.js'] }], // render above everything-else, so it can be found more easily 'react/sort-comp': [ 'warn', { order: [ 'type-annotations', 'static-methods', 'lifecycle', 'render', 'everything-else', ], }, ], // flowtype specific warnings 'flowtype/define-flow-type': 'warn', 'flowtype/require-parameter-type': 'warn', 'flowtype/use-flow-type': 'warn', // eslint-config-prettier rules that might cause problems // see: https://github.com/prettier/eslint-config-prettier#special-rules curly: ['error', 'multi-line'], 'max-len': [ 'error', 80, 4, { ignoreUrls: true, ignoreComments: false, ignoreRegExpLiterals: true, ignoreStrings: true, ignoreTemplateLiterals: true, }, ], 'no-tabs': 'error', // eslint-plugin-prettier rules 'prettier/prettier': ['error', prettierConfig], }, settings: { flowtype: { onlyFilesWithFlowAnnotation: true, }, }, }