Skip to content

Instantly share code, notes, and snippets.

@marsicdev
Created November 4, 2021 12:53
Show Gist options
  • Save marsicdev/6fc470fe7b2cbfdf34d0dceb6ce17f0c to your computer and use it in GitHub Desktop.
Save marsicdev/6fc470fe7b2cbfdf34d0dceb6ce17f0c to your computer and use it in GitHub Desktop.
const pathGroups = ['library', 'app', 'components', 'pages']
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
'prettier',
'plugin:prettier/recommended',
],
plugins: ['import', 'unused-imports'],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
rules: {
'import/order': [
'error',
{
'newlines-between': 'always',
pathGroups: pathGroups.map((path) => ({
pattern: `${path}/**`,
group: 'external',
position: 'after',
})),
pathGroupsExcludedImportTypes: ['builtin'],
},
],
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'unused-imports/no-unused-imports-ts': 'error',
'unused-imports/no-unused-vars-ts': [
'warn',
{ vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' },
],
'react/react-in-jsx-scope': 'off',
'react/react-in-jsx-scope': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-var-requires': 'off',
},
settings: {
react: {
version: 'detect',
},
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment