Skip to content

Instantly share code, notes, and snippets.

@peleteiro
Created April 21, 2020 08:10
Show Gist options
  • Save peleteiro/615280faaa1acc525d59efabf9f4cf7b to your computer and use it in GitHub Desktop.
Save peleteiro/615280faaa1acc525d59efabf9f4cf7b to your computer and use it in GitHub Desktop.
module.exports = {
ignorePatterns: ['!.eslintrc.js', 'dist/', 'raw/', 'lib/', 'node_modules/'],
extends: [
'plugin:import/errors',
'plugin:import/typescript',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:json/recommended',
'prettier/@typescript-eslint',
'plugin:prettier/recommended',
],
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'react/no-unescaped-entities': 'off',
'@typescript-eslint/camelcase': 'off',
'import/order': [
'error',
{
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
'newlines-between': 'always',
groups: ['builtin', 'external', 'internal', 'sibling', 'parent', 'index'],
pathGroups: [
{
pattern: '@biblebox/*',
group: 'internal',
},
{
pattern: '@site/**',
group: 'internal',
},
],
pathGroupsExcludedImportTypes: ['builtin'],
},
],
},
settings: {
react: {
version: 'detect',
},
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true,
directory: './tsconfig.json',
},
},
'import/ignore': ['react', 'lodash', 'debug', 'debounce-promise', 'express', 'remove-accents', 'qs', 'serialize-javascript', 'aws-sdk', 'morgan', 'open', 'simple-oauth2', 'async-file-dl', 'yup', 'request-promise'],
},
overrides: [
{
files: ['**/*.tsx', '**/*.ts'],
parser: '@typescript-eslint/parser',
rules: {
'react/prop-types': 'off',
},
},
{
files: ['**/*.d.ts'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
},
},
{
files: ['*.md', '*.mdx'],
extends: [ 'plugin:mdx/recommended'],
rules: {
'prettier/prettier': [
2,
{
parser: 'markdown',
},
],
},
},
],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment