2021-02-19 08:20:19 -07:00
|
|
|
module.exports = {
|
|
|
|
root: true,
|
|
|
|
parser: '@typescript-eslint/parser',
|
|
|
|
parserOptions: {
|
2021-02-20 09:04:30 -07:00
|
|
|
tsconfigRootDir: __dirname,
|
2021-02-20 09:09:57 -07:00
|
|
|
project: ['./tsconfig.json'],
|
2021-02-19 08:20:19 -07:00
|
|
|
ecmaFeatures: {
|
|
|
|
jsx: true,
|
|
|
|
},
|
|
|
|
ecmaVersion: 2018,
|
|
|
|
sourceType: 'module',
|
|
|
|
},
|
2021-07-08 03:04:48 -06:00
|
|
|
ignorePatterns: ['scripts', 'lib', 'docs', 'app.plugin.js'],
|
2021-02-19 08:20:19 -07:00
|
|
|
plugins: ['@typescript-eslint', 'react', 'react-native', '@react-native-community', 'prettier', 'react-hooks'],
|
|
|
|
extends: [
|
|
|
|
'eslint:recommended',
|
|
|
|
'plugin:@typescript-eslint/recommended',
|
|
|
|
'plugin:react/recommended',
|
|
|
|
'plugin:prettier/recommended',
|
|
|
|
'@react-native-community',
|
|
|
|
'plugin:react-hooks/recommended',
|
|
|
|
],
|
|
|
|
rules: {
|
|
|
|
// eslint
|
|
|
|
semi: 'off',
|
|
|
|
curly: ['warn', 'multi-or-nest', 'consistent'],
|
|
|
|
'no-mixed-spaces-and-tabs': ['warn', 'smart-tabs'],
|
|
|
|
'no-async-promise-executor': 'warn',
|
|
|
|
'require-await': 'warn',
|
|
|
|
'no-return-await': 'warn',
|
|
|
|
'no-await-in-loop': 'warn',
|
|
|
|
'comma-dangle': 'off', // prettier already detects this
|
|
|
|
'no-restricted-syntax': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
selector: 'TSEnumDeclaration',
|
|
|
|
message: "Enums have various disadvantages, use TypeScript's union types instead.",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
// prettier
|
|
|
|
'prettier/prettier': ['warn'],
|
|
|
|
// typescript
|
|
|
|
'@typescript-eslint/no-use-before-define': 'off',
|
2021-02-19 08:23:54 -07:00
|
|
|
'@typescript-eslint/no-unused-vars': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
vars: 'all',
|
|
|
|
args: 'after-used',
|
|
|
|
ignoreRestSiblings: false,
|
|
|
|
varsIgnorePattern: '^_',
|
|
|
|
argsIgnorePattern: '^_',
|
|
|
|
},
|
|
|
|
],
|
2021-02-19 08:20:19 -07:00
|
|
|
'@typescript-eslint/explicit-function-return-type': [
|
|
|
|
'warn',
|
|
|
|
{
|
|
|
|
allowExpressions: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
'@typescript-eslint/no-namespace': 'off',
|
2021-02-19 08:23:54 -07:00
|
|
|
'@typescript-eslint/ban-ts-comment': 'off',
|
|
|
|
'@typescript-eslint/no-unsafe-assignment': 'error',
|
2021-02-19 08:20:19 -07:00
|
|
|
// react plugin
|
|
|
|
'react/no-unescaped-entities': 'off',
|
|
|
|
// react native plugin
|
|
|
|
'react-native/no-unused-styles': 'warn',
|
2021-02-20 09:12:21 -07:00
|
|
|
'react-native/split-platform-components': 'off',
|
2021-02-19 08:20:19 -07:00
|
|
|
'react-native/no-inline-styles': 'warn',
|
2021-02-20 09:08:35 -07:00
|
|
|
'react-native/no-color-literals': 'off',
|
2021-02-19 08:20:19 -07:00
|
|
|
'react-native/no-raw-text': 'off',
|
|
|
|
'react-native/no-single-element-style-arrays': 'warn',
|
2021-03-31 07:59:14 -06:00
|
|
|
'@typescript-eslint/strict-boolean-expressions': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
allowString: false,
|
|
|
|
allowNullableObject: false,
|
|
|
|
allowNumber: false,
|
|
|
|
allowNullableBoolean: true,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
'@typescript-eslint/no-non-null-assertion': 'error',
|
|
|
|
'@typescript-eslint/no-unnecessary-condition': 'error',
|
2021-02-19 08:20:19 -07:00
|
|
|
|
|
|
|
// react hooks
|
|
|
|
'react-hooks/exhaustive-deps': [
|
2021-02-23 03:57:31 -07:00
|
|
|
'error',
|
2021-02-19 08:20:19 -07:00
|
|
|
{
|
2021-03-31 07:59:14 -06:00
|
|
|
additionalHooks: '(useDerivedValue|useAnimatedStyle|useAnimatedProps|useWorkletCallback|useFrameProcessor)',
|
2021-02-19 08:20:19 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
env: {
|
|
|
|
node: true,
|
|
|
|
},
|
2021-05-06 06:11:55 -06:00
|
|
|
globals: {
|
|
|
|
_log: 'readonly',
|
|
|
|
},
|
2021-02-19 08:20:19 -07:00
|
|
|
};
|