Skip to content

Commit 3d9866a

Browse files
committed
refactor: modernize eslint config
1 parent 749e004 commit 3d9866a

File tree

8 files changed

+487
-170
lines changed

8 files changed

+487
-170
lines changed

.eslintignore

Lines changed: 0 additions & 16 deletions
This file was deleted.

.eslintrc.yaml

Lines changed: 0 additions & 109 deletions
This file was deleted.

eslint.config.js

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
// @ts-check
2+
3+
import eslint from '@eslint/js';
4+
import tseslint from 'typescript-eslint';
5+
import react from 'eslint-plugin-react';
6+
import reactHooks from 'eslint-plugin-react-hooks';
7+
import reactNative from 'eslint-plugin-react-native';
8+
import jsxA11y from 'eslint-plugin-jsx-a11y';
9+
import eslintComments from 'eslint-plugin-eslint-comments';
10+
import json from 'eslint-plugin-json';
11+
import imprt from 'eslint-plugin-import';
12+
import prettier from 'eslint-config-prettier';
13+
14+
export default tseslint.config(
15+
{
16+
ignores: [
17+
'node_modules',
18+
'package-lock.json',
19+
'build',
20+
'dist',
21+
'*.expo',
22+
'coverage',
23+
'.github',
24+
'.idea',
25+
'.vscode',
26+
'*.yaml',
27+
'*.yml',
28+
'*.md',
29+
],
30+
},
31+
eslint.configs.recommended,
32+
...tseslint.configs.recommended,
33+
...tseslint.configs.stylistic,
34+
{
35+
plugins: {
36+
react,
37+
'react-hooks': reactHooks,
38+
'react-native': reactNative,
39+
'jsx-a11y': jsxA11y,
40+
'@typescript-eslint': tseslint.plugin,
41+
'eslint-comments': eslintComments,
42+
json,
43+
import: imprt,
44+
},
45+
languageOptions: {
46+
parser: tseslint.parser,
47+
parserOptions: {
48+
ecmaFeatures: {
49+
jsx: true,
50+
},
51+
ecmaVersion: 'latest',
52+
project: './tsconfig.json',
53+
sourceType: 'module',
54+
},
55+
globals: {
56+
JSX: true,
57+
require: true
58+
},
59+
},
60+
rules: {
61+
'@typescript-eslint/array-type': [
62+
'error',
63+
{
64+
default: 'generic',
65+
readonly: 'generic',
66+
},
67+
],
68+
'@typescript-eslint/explicit-function-return-type': 'error',
69+
'@typescript-eslint/explicit-module-boundary-types': 'error',
70+
'@typescript-eslint/no-explicit-any': [
71+
'error',
72+
{
73+
fixToUnknown: false,
74+
ignoreRestArgs: false,
75+
},
76+
],
77+
'@typescript-eslint/no-require-imports': 'off', // diabling until typescript rewrite
78+
'@typescript-eslint/no-shadow': 'error',
79+
'@typescript-eslint/no-use-before-define': 'error',
80+
camelcase: 'error',
81+
'no-underscore-dangle': 'off',
82+
'comma-dangle': ['error', 'always-multiline'],
83+
'comma-style': ['error', 'last'],
84+
'import/extensions': ['error', 'never'],
85+
'import/no-unresolved': 'error',
86+
'jsx-quotes': ['error', 'prefer-single'],
87+
'linebreak-style': ['error', 'unix'],
88+
'max-lines': ['error', 300],
89+
'no-console': 'error',
90+
'no-duplicate-imports': 'error',
91+
'no-multi-spaces': 'error',
92+
'no-shadow': 'error',
93+
'no-template-curly-in-string': 'error',
94+
'no-trailing-spaces': 'error',
95+
'no-undef': 'error',
96+
'no-use-before-define': 'warn',
97+
'react-native/no-inline-styles': 'warn',
98+
'react/jsx-filename-extension': [
99+
'error',
100+
{
101+
extensions: ['.ts', '.tsx', '.js', '.jsx'],
102+
},
103+
],
104+
'react/prop-types': 'off', // Disabling until typescript rewrite
105+
'sort-imports': 'warn',
106+
},
107+
},
108+
prettier,
109+
);

examples/package-lock.json

Lines changed: 27 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"web": "expo start --web"
1111
},
1212
"dependencies": {
13-
"expo": "54.0.12",
13+
"expo": "54.0.13",
1414
"expo-status-bar": "~3.0.8",
1515
"react": "19.1.0",
1616
"react-dom": "19.1.0",

0 commit comments

Comments
 (0)