@platformbuilders/react-elements
Version:
Platform Builders Shared Components Library For React Web
109 lines (108 loc) • 2.93 kB
JavaScript
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
'plugin:prettier/recommended',
'plugin:react/recommended',
'plugin:jsx-a11y/recommended',
'plugin:sonarjs/recommended',
'plugin:promise/recommended',
],
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
ecmaVersion: 2020,
sourceType: 'module',
useJSXTextNode: true,
ecmaFeatures: {
jsx: true,
},
},
plugins: [
'@typescript-eslint',
'react',
'jsx-a11y',
'sonarjs',
'promise',
'import',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
__DEV__: true,
},
ignorePatterns: [
'node_modules/',
'e2e',
'__mocks__',
'coverage',
'_templates',
],
rules: {
// @TODO: Remover essa regra assim que for feito o fix na lib do CheckBox
'@typescript-eslint/ban-ts-comment': 'off',
'react/jsx-filename-extension': ['error', { extensions: ['.jsx', '.tsx'] }],
'react/prop-types': 0,
'react/display-name': 0,
'react/jsx-uses-react': 0,
'react/react-in-jsx-scope': 0,
'@typescript-eslint/member-delimiter-style': 0,
'@typescript-eslint/no-empty-function': 0,
'@typescript-eslint/no-explicit-any': 0,
'import/prefer-default-export': 0,
'import/no-named-as-default': 0,
'import/no-unresolved': 0,
'import/no-extraneous-dependencies': 0,
'import/extensions': 0,
'import/order': [
'error',
{
pathGroups: [
{
pattern: 'react',
group: 'external',
position: 'before',
},
{
pattern: '~/**',
group: 'parent',
position: 'before',
},
{
pattern: '@*/**',
group: 'external',
position: 'after',
},
],
pathGroupsExcludedImportTypes: ['react'],
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
'sort-imports': ['error', { ignoreDeclarationSort: true }],
'jsx-a11y/no-noninteractive-element-interactions': 'off',
'jsx-a11y/no-static-element-interactions': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/no-autofocus': 'off',
'class-methods-use-this': 0,
'no-nested-ternary': 0,
'consistent-return': 0,
'array-callback-return': 0,
'react/jsx-props-no-spreading': 0,
'no-duplicate-imports': 'error',
'promise/prefer-await-to-callbacks': 'error',
'promise/prefer-await-to-then': 'error',
'react/state-in-constructor': 'off',
'react/no-unescaped-entities': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-non-null-assertion': 0,
},
settings: {
react: {
version: 'detect',
},
},
};