-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
39 lines (36 loc) · 1.25 KB
/
Copy patheslint.config.js
File metadata and controls
39 lines (36 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// https://docs.expo.dev/guides/using-eslint/
const { defineConfig } = require('eslint/config');
const expoConfig = require('eslint-config-expo/flat');
const prettierConfig = require('eslint-config-prettier');
const reactNativePlugin = require('eslint-plugin-react-native');
module.exports = defineConfig([
expoConfig,
prettierConfig,
{
ignores: ['dist/*', 'node_modules/*'],
},
{
files: ['**/*.{js,jsx,ts,tsx}'],
plugins: {
'react-native': reactNativePlugin,
},
rules: {
'no-console': ['warn', { allow: ['warn', 'error'] }],
'no-unused-vars': 'off', // Setup Typescript eslint rule below
'no-undef': 'off', // Typescript handles this
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
// React Hooks
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
// React Native best practices
'react-native/no-unused-styles': 'warn',
'react-native/no-inline-styles': 'off', // Often used in rapid dev, set to warn if strict
'react-native/no-color-literals': 'off', // We use theme, but literals are okay sometimes
},
languageOptions: {
parserOptions: {
project: './tsconfig.json',
},
},
},
]);