UNPKG

@codemein/eslint-config-tesco

Version:

Tesco's ESLint config, following Tesco's styleguide

102 lines (101 loc) 3.51 kB
/** * @module Eslint base configuration */ /** * Base Eslint configuration for JS which extends the airbnb-base one. */ module.exports = { env: { jest: true, node: true, }, extends: ['airbnb-base'], parser: 'babel-eslint', plugins: ['sort-class-members'], rules: { 'class-methods-use-this': 0, 'function-paren-newline': ['error', 'consistent'], 'implicit-arrow-linebreak': 0, 'import/no-extraneous-dependencies': 0, 'import/order': ['error', { groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'] }], 'jsx-a11y/anchor-is-valid': 0, 'lines-around-comment': [ 'error', { beforeBlockComment: true, allowBlockStart: true, allowClassStart: false, allowObjectStart: true, allowArrayStart: true, }, ], 'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }], 'max-len': [2, 120, 4], 'no-multiple-empty-lines': ['error', { max: 1 }], 'no-nested-ternary': 0, 'no-param-reassign': ['error', { props: false }], 'no-underscore-dangle': 0, 'object-curly-newline': [ 'error', { ObjectExpression: { consistent: true }, ObjectPattern: { consistent: true }, ImportDeclaration: { consistent: true }, ExportDeclaration: { consistent: true }, }, ], 'one-var': ['error', { initialized: 'never' }], 'one-var-declaration-per-line': ['error', 'initializations'], 'padding-line-between-statements': [ 'error', { blankLine: 'any', prev: '*', next: '*' }, { blankLine: 'always', prev: 'multiline-block-like', next: '*' }, { blankLine: 'always', prev: '*', next: 'multiline-block-like' }, { blankLine: 'always', prev: 'multiline-expression', next: '*' }, { blankLine: 'always', prev: '*', next: 'multiline-expression' }, { blankLine: 'always', prev: 'directive', next: '*' }, { blankLine: 'always', prev: '*', next: 'directive' }, ], 'sort-class-members/sort-class-members': [ 2, { accessorPairPositioning: 'getThenSet', groups: { 'static-properties': [{ static: true, type: 'property', sort: 'alphabetical' }], 'static-private-properties': [{ name: '/_.+/', static: true, type: 'property', sort: 'alphabetical' }], 'static-methods': [{ static: true, type: 'method', sort: 'alphabetical' }], 'static-private-methods': [{ name: '/_.+/', static: true, type: 'method', sort: 'alphabetical' }], properties: [{ type: 'property', sort: 'alphabetical' }], 'private-properties': [{ name: '/_.+/', type: 'property', sort: 'alphabetical' }], methods: [{ type: 'method', sort: 'alphabetical' }], 'private-methods': [{ name: '/_.+/', type: 'method', sort: 'alphabetical' }], }, order: [ '[static-properties]', '[static-private-properties]', '[static-methods]', '[static-private-methods]', '[properties]', '[private-properties]', 'constructor', 'getters', 'setters', '[methods]', '[private-methods]', ], }, ], 'valid-jsdoc': ['warn'], 'require-jsdoc': [ 'warn', { require: { FunctionDeclaration: true, MethodDefinition: true, ClassDeclaration: true, ArrowFunctionExpression: true, }, }, ], }, };