@react-ddd/eslint-config
This package is a draconian eslint-config largely based on
airbnb and
airbnb-typescript.
It does NOT use Prettier, instead relying on only one tool to handle code
formatting.
Differences from airbnb and airbnb-typescript
Use arrow functions for all components
Disable
Disable, as we use TypeScript and type the props
Only in .tsx files Ignore for generics, so that you can have a single unconstrained generic for components:
const GenericComponent<T,> = (...) => {}
Disable ignoring single line. ALL braces are required, no single line if's!
Force TypeScript 3.8 style type imports for all types
Error, except for short circuit and ternary
Testing specific rules
There are specific rules for *.spec.tsx?
files to accomodate jest-gwt
style testing:
rules: {
'max-len': [
'error',
{
code: 100,
ignoreUrls: true,
ignoreRegExpLiterals: true,
ignorePattern,
},
],
'react/no-this-in-sfc': 'off',
camelcase: 'off',
'@typescript-eslint/naming-convention': 'off',
'prefer-arrow-callback': 'off',
'func-names': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'no-param-reassign': 'off',
}