@ajaysidhu/react-native-template
Version:
It is a minimalist React Native template with preconfigured common set of packages to start a new app.
78 lines (77 loc) • 1.98 kB
JavaScript
module.exports = {
root: true,
extends: '@react-native',
plugins: ['import'],
overrides: [
{
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2021,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
project: './tsconfig.json',
},
},
],
rules: {
semi: ['error', 'always'],
quotes: ['error', 'single', {avoidEscape: true, allowTemplateLiterals: true}],
indent: ['error', 2, {SwitchCase: 1, ignoredNodes: ['PropertyDefinition']}],
// Enforce no spaces in import/export braces: {scale} ✓, { scale } ✗
'object-curly-spacing': ['error', 'never'],
'comma-dangle': ['error', 'always-multiline'],
'computed-property-spacing': 'off',
'key-spacing': ['error', {beforeColon: false, afterColon: true}],
'no-trailing-spaces': 'error',
'no-multiple-empty-lines': ['error', {max: 1, maxEOF: 0}],
'eol-last': ['error', 'always'],
'import/first': 1,
'import/newline-after-import': 1,
'import/no-cycle': 2,
'import/no-duplicates': 1,
'import/no-unresolved': 2,
'import/order': [
'error',
{
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
],
pathGroups: [
{
pattern: '~/**',
group: 'internal',
},
],
pathGroupsExcludedImportTypes: ['builtin'],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
warnOnUnassignedImports: true,
},
],
},
env: {
'jest/globals': true,
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true,
project: './tsconfig.json',
},
},
},
};