@@ -8,16 +8,18 @@ const ignores = globalIgnores(['.expo/', 'expo-env.d.ts'])
88/** @type {import("eslint").Linter.Config } */
99const common = {
1010 rules : {
11- // Very expensive check
11+ // Very expensive check, see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/namespace.md
1212 'import/namespace' : 'off' ,
13- // Very expensive check
13+ // Very expensive check, see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-duplicates.md
1414 'import/no-duplicates' : 'off' ,
15- // Handled by TypeScript
15+ // Handled by TypeScript, see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-unresolved.md
1616 'import/no-unresolved' : 'off' ,
1717 // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-as-default.md
1818 'import/no-named-as-default' : 'off' ,
19+ // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-as-default-member.md
1920 'import/no-named-as-default-member' : 'off' ,
2021 // Handled by TypeScript. Enable noUnusedLocals in your tsconfig.json, see https://www.typescriptlang.org/tsconfig/#noUnusedLocals
22+ // https://eslint.org/docs/latest/rules/no-unused-vars
2123 'no-unused-vars' : 'off' ,
2224 } ,
2325}
@@ -26,6 +28,7 @@ const common = {
2628const react = {
2729 files : [ '**/*.jsx' , '**/*.tsx' ] ,
2830 rules : {
31+ // Enforce alphabetical sorting of props for better readability, see https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md
2932 'react/jsx-sort-props' : [
3033 'error' ,
3134 {
@@ -35,6 +38,7 @@ const react = {
3538 shorthandLast : true ,
3639 } ,
3740 ] ,
41+ // DisplayName is not required for React Native components, see https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/display-name.md
3842 'react/display-name' : 'off' ,
3943 } ,
4044}
@@ -44,20 +48,30 @@ const typescript = defineConfig([typeScriptConfig, {
4448 files : [ '**/*.ts' , '**/*.tsx' ] ,
4549 rules : {
4650 // Handled by TypeScript. Enable noUnusedLocals in your tsconfig.json, see https://www.typescriptlang.org/tsconfig/#noUnusedLocals
51+ // https://typescript-eslint.io/rules/no-unused-vars/
4752 '@typescript-eslint/no-unused-vars' : 'off' ,
4853 // Its common in React Native to import types using require syntax, see https://reactnative.dev/docs/images#static-image-resources
54+ // https://typescript-eslint.io/rules/no-require-imports/
4955 '@typescript-eslint/no-require-imports' : 'off' ,
50- // Very expensive check
56+ // Very expensive check, see https://typescript-eslint.io/rules/promise-function-async/
5157 '@typescript-eslint/promise-function-async' : 'off' ,
5258
59+ // Allows variable shadowing in TypeScript contexts, see https://typescript-eslint.io/rules/no-shadow/
5360 '@typescript-eslint/no-shadow' : 'off' ,
61+ // Allows both interface and type definitions, see https://typescript-eslint.io/rules/consistent-type-definitions/
5462 '@typescript-eslint/consistent-type-definitions' : 'off' ,
63+ // Allows Promises in places where they might not be handled properly, see https://typescript-eslint.io/rules/no-misused-promises/
5564 '@typescript-eslint/no-misused-promises' : 'off' ,
65+ // Allows assignments of any typed values, see https://typescript-eslint.io/rules/no-unsafe-assignment/
5666 '@typescript-eslint/no-unsafe-assignment' : 'off' ,
67+ // Allows returning any typed values from functions, see https://typescript-eslint.io/rules/no-unsafe-return/
5768 '@typescript-eslint/no-unsafe-return' : 'off' ,
69+ // Allows unbound method references that may lose 'this' context, see https://typescript-eslint.io/rules/unbound-method/
5870 '@typescript-eslint/unbound-method' : 'off' ,
71+ // Allows member access on any typed values, see https://typescript-eslint.io/rules/no-unsafe-member-access/
5972 '@typescript-eslint/no-unsafe-member-access' : 'off' ,
6073
74+ // Enforce consistent type imports with inline style, see https://typescript-eslint.io/rules/consistent-type-imports/
6175 '@typescript-eslint/consistent-type-imports' : [
6276 'error' ,
6377 { prefer : 'type-imports' , fixStyle : 'inline-type-imports' } ,
0 commit comments