Skip to content

Commit 9a8db8d

Browse files
committed
chore: update eslint config
1 parent 4c062bd commit 9a8db8d

File tree

5 files changed

+836
-138
lines changed

5 files changed

+836
-138
lines changed

eslint.config.mjs

+7-30
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,10 @@
11
// eslint-disable-next-line import-x/extensions,import-x/no-unresolved
22
import { defineConfig, globalIgnores } from 'eslint/config';
3-
import satya164 from 'eslint-config-satya164';
4-
import vitest from '@vitest/eslint-plugin';
3+
import { recommended, vitest } from 'eslint-config-satya164';
54

6-
export default defineConfig([
7-
satya164,
8-
9-
{
10-
files: ['**/*.{spec,test}.{js,ts,tsx}', '**/__tests__/**/*.{js,ts,tsx}'],
11-
12-
plugins: {
13-
vitest,
14-
},
15-
16-
rules: {
17-
...vitest.configs.recommended.rules,
18-
19-
'vitest/consistent-test-it': ['error', { fn: 'test' }],
20-
'vitest/expect-expect': 'error',
21-
'vitest/no-disabled-tests': 'error',
22-
'vitest/no-duplicate-hooks': 'error',
23-
'vitest/no-test-prefixes': 'error',
24-
'vitest/no-test-return-statement': 'error',
25-
'vitest/prefer-to-be': 'error',
26-
'vitest/prefer-todo': 'error',
27-
'vitest/require-to-throw-message': 'error',
28-
29-
'jest/no-deprecated-functions': 'off',
30-
},
31-
},
5+
export default defineConfig(
6+
recommended,
7+
vitest,
328

339
globalIgnores([
3410
'**/.next/',
@@ -37,8 +13,9 @@ export default defineConfig([
3713
'**/.vscode/',
3814
'**/node_modules/',
3915
'**/coverage/',
16+
'**/out/',
4017
'**/lib/',
4118
'**/templates/',
4219
'**/__fixtures__/',
43-
]),
44-
]);
20+
])
21+
);

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
"@vitest/eslint-plugin": "^1.1.39",
3030
"commitlint": "^17.0.2",
3131
"concurrently": "^7.2.2",
32-
"eslint": "^9.23.0",
33-
"eslint-config-satya164": "^4.0.1",
32+
"eslint": "^9.26.0",
33+
"eslint-config-satya164": "^5.0.3",
3434
"globals": "^16.0.0",
35-
"prettier": "^3.0.3",
35+
"prettier": "^3.5.3",
3636
"typescript": "^5.2.2"
3737
},
3838
"commitlint": {

packages/create-react-native-library/src/input.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,9 @@ export async function createQuestions({
224224
message: 'What is the name of the npm package?',
225225
initial: (_, answers) => {
226226
const basename = path.basename(
227-
typeof answers.directory === 'string' ? answers.directory : name ?? ''
227+
typeof answers.directory === 'string'
228+
? answers.directory
229+
: (name ?? '')
228230
);
229231

230232
if (validateNpmPackage(basename).validForNewPackages) {
@@ -248,22 +250,22 @@ export async function createQuestions({
248250
validate: (input) => Boolean(input) || 'Cannot be empty',
249251
},
250252
{
251-
type: (_, answers) => (answers.local ?? local ? null : 'text'),
253+
type: (_, answers) => ((answers.local ?? local) ? null : 'text'),
252254
name: 'authorName',
253255
message: 'What is the name of package author?',
254256
initial: fullname,
255257
validate: (input) => Boolean(input) || 'Cannot be empty',
256258
},
257259
{
258-
type: (_, answers) => (answers.local ?? local ? null : 'text'),
260+
type: (_, answers) => ((answers.local ?? local) ? null : 'text'),
259261
name: 'authorEmail',
260262
message: 'What is the email address for the package author?',
261263
initial: email,
262264
validate: (input) =>
263265
/^\S+@\S+$/.test(input) || 'Must be a valid email address',
264266
},
265267
{
266-
type: (_, answers) => (answers.local ?? local ? null : 'text'),
268+
type: (_, answers) => ((answers.local ?? local) ? null : 'text'),
267269
name: 'authorUrl',
268270
message: 'What is the URL for the package author?',
269271
initial: async (_, answers) => {
@@ -284,7 +286,7 @@ export async function createQuestions({
284286
validate: (input) => /^https?:\/\//.test(input) || 'Must be a valid URL',
285287
},
286288
{
287-
type: (_, answers) => (answers.local ?? local ? null : 'text'),
289+
type: (_, answers) => ((answers.local ?? local) ? null : 'text'),
288290
name: 'repoUrl',
289291
message: 'What is the URL for the repository?',
290292
initial: (_, answers) => {

packages/react-native-builder-bob/src/schema.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ export type Target = typeof target.infer;
7777
export type TargetOptions<T extends Target> = T extends typeof commonjs.name
7878
? typeof commonjs.options.infer
7979
: T extends typeof module.name
80-
? typeof module.options.infer
81-
: T extends typeof typescript.name
82-
? typeof typescript.options.infer
83-
: T extends typeof custom.name
84-
? typeof custom.options.infer
85-
: T extends typeof codegen.name
86-
? undefined
87-
: never;
80+
? typeof module.options.infer
81+
: T extends typeof typescript.name
82+
? typeof typescript.options.infer
83+
: T extends typeof custom.name
84+
? typeof custom.options.infer
85+
: T extends typeof codegen.name
86+
? undefined
87+
: never;

0 commit comments

Comments
 (0)