Skip to content

Instantly share code, notes, and snippets.

@mejta
Created May 28, 2020 13:27
Show Gist options
  • Select an option

  • Save mejta/27957ac2f9ffb8df24efa747ca59ae0b to your computer and use it in GitHub Desktop.

Select an option

Save mejta/27957ac2f9ffb8df24efa747ca59ae0b to your computer and use it in GitHub Desktop.
module.exports = {
extends: ['airbnb', 'plugin:jest/recommended'],
parser: 'typescript-eslint-parser',
plugins: ['typescript', 'babel', 'jest', 'react-hooks'],
env: {
'browser': true,
'node': true,
'jest/globals': true,
},
parserOptions: {
jsx: true,
useJSXTextNode: true,
},
globals: {
document: false,
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
},
},
},
rules: {
'function-paren-newline': 'off',
'jsx-a11y/anchor-is-valid': 'off',
'jsx-a11y/img-redundant-alt': 'off',
'jsx-a11y/label-has-associated-control': 'off',
'jsx-a11y/label-has-for': 'off',
'import/no-named-as-default': 'off',
'no-shadow': 'off',
'react/destructuring-assignment': 'off',
'react/jsx-filename-extension': ['error', { extensions: ['.tsx', '.jsx'] }],
'no-unused-vars': 'off', // error: typescript imported interfaces are validated as unused
'no-param-reassign': ['error', { ignorePropertyModificationsFor: ['draft'] }], // draft variable from immer
'spaced-comment': ['error', 'always', { markers: ['/'] }], // enables comments /// <...> for ts declarations
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: [
'**/*.js',
'**/*.test.*',
'**/common/tests.ts',
],
},
],
'max-len': ['error', 100, 2, {
ignoreUrls: true,
ignoreComments: true,
ignoreRegExpLiterals: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
}],
'react-hooks/rules-of-hooks': 'error',
'react/prop-types': 'off',
'arrow-body-style': 'warn'
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment