Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a2727f6

Browse files
fix(lint): replace unmaintained sort keys with stable sort
1 parent 6123ddc commit a2727f6

File tree

44 files changed

+338
-284
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+338
-284
lines changed

‎template/.prettierrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
module.exports = {
2-
singleQuote: true,
3-
plugins: ['@ianvs/prettier-plugin-sort-imports'],
42
importOrder: [
53
'<TYPES>^(node:)',
64
'<TYPES>',
@@ -25,4 +23,6 @@ module.exports = {
2523
'^[.]', // relative imports
2624
],
2725
importOrderTypeScriptVersion: '5.0.0',
26+
plugins: ['@ianvs/prettier-plugin-sort-imports'],
27+
singleQuote: true,
2828
};

‎template/babel.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
/** @type {import('ts-jest').JestConfigWithTsJest} */
22
module.exports = {
3-
presets: ['module:@react-native/babel-preset'],
43
plugins: [
54
[
65
'module-resolver',
76
{
8-
root: ['./src'],
9-
extensions: ['.js', '.json'],
107
alias: {
118
'@': './src',
129
},
10+
extensions: ['.js', '.json'],
11+
root: ['./src'],
1312
},
1413
],
1514
'inline-dotenv',
1615
'react-native-reanimated/plugin', // needs to be last
1716
],
17+
presets: ['module:@react-native/babel-preset'],
1818
};

‎template/eslint.config.mjs

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { dirname } from 'node:path';
22
import { fileURLToPath } from 'node:url';
33
import importPlugin from 'eslint-plugin-import';
44
import jest from 'eslint-plugin-jest';
5+
import perfectionist from 'eslint-plugin-perfectionist';
56
import react from 'eslint-plugin-react';
67
import reactHooks from 'eslint-plugin-react-hooks';
7-
import typescriptSortKeys from 'eslint-plugin-typescript-sort-keys';
88
import unicorn from 'eslint-plugin-unicorn';
99
import unusedImports from 'eslint-plugin-unused-imports';
1010
import tsEslint from 'typescript-eslint';
@@ -18,24 +18,25 @@ export default [
1818
files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'],
1919
plugins: {
2020
import: importPlugin,
21+
jest,
22+
perfectionist,
2123
react,
2224
'react-hooks': reactHooks,
2325
unicorn,
2426
'unused-imports': unusedImports,
25-
jest,
2627
},
2728
rules: {
28-
'import/no-unresolved': 0, // handled by TypeScript
29-
'unicorn/prefer-top-level-await': 0, // not valid on RN for the moment
30-
curly: 2,
3129
// `import/default`, `import/namespace` and `import/no-duplicates` are slow.
30+
curly: 2,
3231
'import/default': 0,
3332
'import/named': 0,
3433
'import/namespace': 0,
3534
'import/no-duplicates': 0,
3635
'import/no-extraneous-dependencies': 2,
3736
'import/no-named-as-default-member': 0,
37+
'import/no-unresolved': 0,
3838
'import/order': 0,
39+
'no-console': 2,
3940
'no-const-assign': 2,
4041
'no-constant-binary-expression': 2,
4142
'no-extra-parens': [2, 'functions'],
@@ -46,14 +47,30 @@ export default [
4647
'no-unused-vars': 0,
4748
'no-useless-rename': 2,
4849
'no-var': 2,
49-
'no-console': 2,
5050
'no-warning-comments': [2, { terms: ['@nocommit'] }],
5151
'object-curly-spacing': 0,
5252
'object-shorthand': 2,
53+
'perfectionist/sort-array-includes': 'error',
54+
'perfectionist/sort-classes': 'error',
55+
'perfectionist/sort-enums': 'error',
56+
'perfectionist/sort-exports': 'error',
57+
'perfectionist/sort-imports': 0,
58+
'perfectionist/sort-interfaces': 'error',
59+
'perfectionist/sort-intersection-types': 'error',
60+
'perfectionist/sort-jsx-props': 'error',
61+
'perfectionist/sort-maps': 'error',
62+
'perfectionist/sort-named-exports': 'error',
63+
'perfectionist/sort-named-imports': 'error',
64+
'perfectionist/sort-object-types': 'error',
65+
'perfectionist/sort-objects': 'error',
66+
'perfectionist/sort-sets': 'error',
67+
'perfectionist/sort-switch-case': 'error',
68+
'perfectionist/sort-union-types': 'error',
69+
'perfectionist/sort-variable-declarations': 'error',
5370
'prefer-arrow-callback': [2, { allowNamedFunctions: true }],
5471
'prefer-const': 2,
5572
'react-hooks/exhaustive-deps': 2,
56-
'react/jsx-sort-props': 2,
73+
'react/jsx-sort-props': 0,// Handled by perfectionist
5774
'react/prop-types': 2,
5875
'react/react-in-jsx-scope': 0,
5976
'react/require-default-props': [
@@ -92,10 +109,15 @@ export default [
92109
'unicorn/prefer-string-slice': 2,
93110
'unicorn/prefer-structured-clone': 2,
94111
'unicorn/prefer-ternary': 2,
112+
'unicorn/prefer-top-level-await': 0, // not valid on RN for the moment
95113
'unicorn/text-encoding-identifier-case': 2,
96114
'unused-imports/no-unused-imports': 0,
97115
},
98116
settings: {
117+
perfectionist: {
118+
partitionByComment: true,
119+
type: 'alphabetical',
120+
},
99121
react: {
100122
version: 'detect',
101123
},
@@ -105,31 +127,28 @@ export default [
105127
files: ['**/*.ts', '**/*.tsx'],
106128
languageOptions: {
107129
ecmaVersion: 'latest',
108-
sourceType: 'module',
109130
parser: tsEslint.parser,
110131
parserOptions: {
111132
project: ['./tsconfig.json'],
112133
tsconfigRootDir: __dirname,
113134
},
135+
sourceType: 'module',
114136
},
115137
plugins: {
116138
'@typescript-eslint': tsEslint.plugin,
117-
'typescript-sort-keys': typescriptSortKeys,
118139
},
119140
rules: {
120-
'import/no-unresolved': 0, // handled by TypeScript
121-
'@typescript-eslint/consistent-type-imports': 2,
122141
'@typescript-eslint/ban-ts-comment': 0,
142+
'@typescript-eslint/consistent-type-imports': 2,
123143
'@typescript-eslint/no-dynamic-delete': 0,
124144
'@typescript-eslint/no-invalid-void-type': 0,
125145
'@typescript-eslint/no-namespace': 0,
126146
'@typescript-eslint/no-non-null-assertion': 0,
127147
'@typescript-eslint/no-this-alias': 0,
128148
'@typescript-eslint/no-unused-vars': 0,
129149
'@typescript-eslint/no-var-requires': 0,
150+
'import/no-unresolved': 0, // handled by TypeScript
130151
'react/prop-types': 0,
131-
'typescript-sort-keys/interface': 2,
132-
'typescript-sort-keys/string-enum': 2,
133152
},
134153
},
135154
{

‎template/ios/Boilerplate.xcodeproj/project.pbxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,7 @@
504504
"-lc++",
505505
);
506506
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
507+
"PRODUCT_BUNDLE_IDENTIFIER[sdk=iphoneos*]" = tcm.app.boilerplate;
507508
PRODUCT_NAME = Boilerplate;
508509
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
509510
SWIFT_VERSION = 5.0;

‎template/ios/Podfile.lock

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2031,66 +2031,66 @@ SPEC CHECKSUMS:
20312031
RCTTypeSafety: 23df4344c69c602e1c5a8053a93c633af1bee825
20322032
React: cf99f97aa57ce39ab4d3d4f396e01a3f30f3c8ad
20332033
React-callinvoker: bec5283f86b784de5a1ba807e31cb4f177765507
2034-
React-Core: 3b131c387be8d45565fc32c6c08df7a450d8d5a8
2035-
React-CoreModules: ac0a55891bcb72a9f8c6631128e7cbbf9ce06b65
2036-
React-cxxreact: fec14d0078f627985b2cce98f90458e969a848ae
2034+
React-Core: 606c08c616ffad997ad9ebb1e0492af57a23b023
2035+
React-CoreModules: 8d9b8656e2a944798ab84b50efbd16df856af972
2036+
React-cxxreact: 447f344bac6ff34795336c65ff39c61674809833
20372037
React-debug: c185808d0674717d0d408d7ce45a7343f0072199
2038-
React-defaultsnativemodule: 5dc781a1e3274cbb6d6d3e91f5bf9914a258115d
2039-
React-domnativemodule: f81f69be048840a0efcf0add685ad0cf5583fb5f
2040-
React-Fabric: 8de8a37b62f81d264302462cf33c69b97faf9979
2041-
React-FabricComponents: 777f5e4fdc39355fa0275412a3b8f2430a7bef1d
2042-
React-FabricImage: 9202f25c36040de738cd486ea6b8480f2d62b05f
2038+
React-defaultsnativemodule: 80c874b2cda84025db4b1522a0efed08b878fecf
2039+
React-domnativemodule: 7655f2e86d57a0dc1438a3927ff023507af2b3bd
2040+
React-Fabric: b0b873f603d5b3cabd50544e3aa2f8a13b463825
2041+
React-FabricComponents: 30a8b512e249e3c95d63ab1ad5e7b3b7f7d2ad6b
2042+
React-FabricImage: e05e0529655951ed49b4cb30c60676c933c1c3a0
20432043
React-featureflags: 51f1373ac42cefac4936c62be46dbe2a1f9f1f7d
2044-
React-featureflagsnativemodule: 59083d49f82a50aecba32e1cddb791ca362df198
2045-
React-graphics: 4508c3473dd97c76d627938bfa0c304abc37e3b0
2046-
React-hermes: 9d2b208eb88bfd4eb156064a831bec2f01e8165d
2047-
React-idlecallbacksnativemodule: fc31bde9dc276e78d4289b4fd209b5fbe762600b
2048-
React-ImageManager: f046a503ff853fc5aec31db274c03cea239e5de4
2049-
React-jserrorhandler: a03ee04881559e8a0cdcd0cb7dbbc4d1c78edc9d
2050-
React-jsi: b7efc160dd211f6a3999cdc4a2c9fc2bbcda05db
2051-
React-jsiexecutor: 4ec7211a13582bd954c79590996260afffb64b30
2052-
React-jsinspector: d913f0d6c32cca8f090cc0c1dfc3c95ec65970b8
2053-
React-jsitracing: 043658000ac681e8aa5f3ee61690e0686da01bfe
2054-
React-logger: d1a89c7d9b3c847eb63eb85724c54b06cae2c939
2055-
React-Mapbuffer: b0b4ace5b62b269f3838df26ba2d8b4f39f90783
2056-
React-microtasksnativemodule: 0b7db04c18f6bb01ef5b1f9007c3229abecc35dd
2057-
react-native-mmkv: bb0824bed68c01f7cc681eefa58059097bdaa796
2058-
react-native-safe-area-context: 2279fe040bc93af8624f7d034806180fdbe5fa02
2044+
React-featureflagsnativemodule: 1b5707a45fb1cd5d5a8eecb837b7d992f362ad19
2045+
React-graphics: 5f197ffaa7f76e443eccd28806143cc5ad3aab05
2046+
React-hermes: 720ea93c58230637654248f295bb538afd6bc8c1
2047+
React-idlecallbacksnativemodule: d251113534012c4908ae532af87f254529b73b6b
2048+
React-ImageManager: 6d0ca1ef4334d48fe6d9cf2f4d8f828eff093b50
2049+
React-jserrorhandler: a898b496ec2e341d33c58d30425ec639aa2613ec
2050+
React-jsi: af2b22c5fe7c5bb7d79ff745d488911e43d8d9a1
2051+
React-jsiexecutor: 9f3dee433658d00adc736eadcda20f72caca5364
2052+
React-jsinspector: 4bb41975b631cb8e8ad81c36094893758c0dc13d
2053+
React-jsitracing: d7c6046b9ed426a27891e8bf7a603b1a29b7205c
2054+
React-logger: 2b39f3941d8c3aea5ebdefe3389c793406abcc27
2055+
React-Mapbuffer: b288fcce9c939b37940cff7a8fbdce0bc23b5cfa
2056+
React-microtasksnativemodule: cf1584fdc26003a6e7bf02b9d591e2d8353f7b75
2057+
react-native-mmkv: eca12be5e3400be2d995a2edaa3c6c2e67b5e3ec
2058+
react-native-safe-area-context: 17800bbaacdd18289d68ac8d4eb541c1a183463f
20592059
React-nativeconfig: 72c10ff34863148ef90df9c9c8eacba99d2faaaa
2060-
React-NativeModulesApple: 5ec49182fa000b2215ee1bed03e2867f8323ccf5
2061-
React-perflogger: 073c7a8a436b3fe724f1df34e9d1f3db1d25fe74
2062-
React-performancetimeline: 52f8e3b73b98dad5d5ba360035ad0be294087bd8
2060+
React-NativeModulesApple: 71fd2cce69bcd2c46673cf6afedb4935b47bf230
2061+
React-perflogger: a31d0c57b4121ca087bf311ea4bd51e81760bcfb
2062+
React-performancetimeline: 63e5abfe91449948ff31022a1f87ace420de14cc
20632063
React-RCTActionSheet: 96cf4d93fccb7a96ba1867e173c586e7ad9cd5cc
2064-
React-RCTAnimation: bcd2356245abffd232ea8d4d5b64ae0bf93c7ef0
2065-
React-RCTAppDelegate: 20242d0ddf9348f8de10e5750d8c0844e222b0e3
2066-
React-RCTBlob: 7fadfb83ce2bb5580b73368384fe242aaa6ddbc6
2067-
React-RCTFabric: 504fe0307b1e72d093aa84e1c5ccb26d1bca66e3
2068-
React-RCTImage: fdf95e50ad94842fd9c508ed36d9bfd6e1ffa8ef
2069-
React-RCTLinking: 76a398421d9a26422e5733439e2a9d13f19e5a99
2070-
React-RCTNetwork: 2bf6ca74a1a14648f6985cfbfc4f8813fa66e6a4
2071-
React-RCTSettings: 3cd121542bb87d318df5102bffdfd85899896187
2072-
React-RCTText: 78b41d87d44c07ac8b2c47172da28a85446d254b
2073-
React-RCTVibration: 245a4a1b33f1c2c9622d4480cf5bb4362096214d
2064+
React-RCTAnimation: 361ed213a028e88d9a284ec824156061b546d1b0
2065+
React-RCTAppDelegate: 08639e5334a574add0473865e0060a2426f567fc
2066+
React-RCTBlob: 2591910793e3a0b2dfb8ef9d5be19efe2e674507
2067+
React-RCTFabric: e6aaa372f4f40e89fec39bee742a6293ed93be82
2068+
React-RCTImage: b3f015ec16e8f5c47a0d09aa56bd5d88b9b66f3e
2069+
React-RCTLinking: b94e819fbbb1559b9858383e0bd29f5be6a817bd
2070+
React-RCTNetwork: 5c84d2bd7346fd0aaf59b47aa07b9ea0742ce1d0
2071+
React-RCTSettings: ea4e9a4fb4e0d752074a98ac72d2b0d28e68f817
2072+
React-RCTText: 037ca05c9552e1745a38158847109d35a14e0a56
2073+
React-RCTVibration: 888510c38bc19eff114f26b5a1014ff49f2bbc24
20742074
React-rendererconsistency: db2497919f3ab2543e3af19fbcef384ddfeb97ad
2075-
React-rendererdebug: ae62b22e402083d1a23539b90873f0513eaa1fec
2075+
React-rendererdebug: 2d22c676effb69a47b37477c5a955df70f527a5f
20762076
React-rncore: 5c0cefbd816edc0438f9f0782c3fd4a4b4ef5770
2077-
React-RuntimeApple: 82c8072c3b35aead653f9abe66397f678a92764f
2078-
React-RuntimeCore: 286b297ab0c5905c9fa83afe1a2df5bfe5edb5a7
2077+
React-RuntimeApple: 33a1d78ebdc40a257a07c985bc8e0faa58c8e6a7
2078+
React-RuntimeCore: 5e98aedf9be94d2e76d1c7cff1308fb4e01ff2e8
20792079
React-runtimeexecutor: 79e15d2c4b261925ea52261f69cac6318db5ab91
2080-
React-RuntimeHermes: 0d4d9a9dae3be2de2df8ec9da2390b3c7097e115
2081-
React-runtimescheduler: b11553b58430aa51b1558ffa93073257dadb00ef
2080+
React-RuntimeHermes: b44b3c800b3e0ed954750220882abc4519e39c5a
2081+
React-runtimescheduler: eb2e5fe044e57d9451667957a0cf66c1cf87c38e
20822082
React-timing: 8458b1f6741bfa16c78aa0a39fde969c6b843e23
2083-
React-utils: d9624101245ebaab39c9f1bd786132da0b4f27ff
2084-
ReactCodegen: dbfef1fef26f42c900bb1884fa149d49d501d64d
2085-
ReactCommon: 429ca28cd813c31359c73ffac6dc24f93347d522
2086-
RNCMaskedView: 090213d32d8b3bb83a4dcb7d12c18f0152591906
2087-
RNGestureHandler: fc5ce5bf284640d3af6431c3a5c3bc121e98d045
2088-
RNReanimated: 77242c6d67416988a2fd9f5cf574bb3e60016362
2089-
RNScreens: de6e57426ba0e6cbc3fb5b4f496e7f08cb2773c2
2090-
RNSVG: 536cd3c866c878faf72beaba166c8b02fe2b762b
2083+
React-utils: e74516d5b9483c5530ec61e249e28b88729321d2
2084+
ReactCodegen: ff7512e124e3dc1363a4930a209d033354d2042a
2085+
ReactCommon: cde69a75746e8d7131f61c27155ee9dc42117003
2086+
RNCMaskedView: de80352547bd4f0d607bf6bab363d826822bd126
2087+
RNGestureHandler: 16ef3dc2d7ecb09f240f25df5255953c4098819b
2088+
RNReanimated: e01050e272623a49aba628de3dfd2b539b8cc4c6
2089+
RNScreens: b941e3ee5fe1991bd25098b5fc8d72db88678793
2090+
RNSVG: 030717ff82ea8f2117347c2fcf52a2d1eafba9ba
20912091
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
20922092
Yoga: f8ec45ce98bba1bc93dd28f2ee37215180e6d2b6
20932093

20942094
PODFILE CHECKSUM: 4bea9319ee17db7a97dff3ce97baf62983342d1c
20952095

2096-
COCOAPODS: 1.15.2
2096+
COCOAPODS: 1.16.0

‎template/jest.config.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
module.exports = {
2-
preset: '@testing-library/react-native',
2+
collectCoverageFrom: [
3+
'<rootDir>/src/Components/**/*.{jsx, tsx}',
4+
'<rootDir>/src/App.{jsx, tsx}',
5+
],
6+
coverageReporters: ['html', 'text', 'text-summary', 'cobertura'],
37
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
8+
preset: '@testing-library/react-native',
49
setupFilesAfterEnv: [
510
'./node_modules/react-native-gesture-handler/jestSetup.js',
611
'<rootDir>/jest.setup.js',
712
],
13+
testMatch: ['**/*.test.ts?(x)', '**/*.test.js?(x)'],
814
transformIgnorePatterns: [
915
'node_modules/(?!(jest-)?react-native|@react-native|@react-native-community|@react-navigation|ky)',
1016
],
11-
collectCoverageFrom: [
12-
'<rootDir>/src/Components/**/*.{jsx, tsx}',
13-
'<rootDir>/src/App.{jsx, tsx}',
14-
],
15-
coverageReporters: ['html', 'text', 'text-summary', 'cobertura'],
16-
testMatch: ['**/*.test.ts?(x)', '**/*.test.js?(x)'],
1717
};

‎template/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@
6363
"eslint-plugin-import": "^2.31.0",
6464
"eslint-plugin-jest": "^28.8.3",
6565
"eslint-plugin-no-instanceof": "^1.0.1",
66+
"eslint-plugin-perfectionist": "^3.9.1",
6667
"eslint-plugin-react": "^7.37.1",
67-
"eslint-plugin-react-hooks": "^5.1.0-rc-70fb1363-20241010",
68-
"eslint-plugin-typescript-sort-keys": "^3.3.0",
68+
"eslint-plugin-react-hooks": "^5.0.0",
6969
"eslint-plugin-unicorn": "^56.0.0",
7070
"eslint-plugin-unused-imports": "^4.1.4",
7171
"jest": "^29.7.0",

‎template/plugins/compile-js/_prompts.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
2-
type: 'confirm',
32
color: 'blue',
4-
message: '📘 Using typescript ?',
53
initial: true,
4+
message: '📘 Using typescript ?',
5+
type: 'confirm',
66
};

‎template/plugins/compile-js/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const promptsOptions = require('./_prompts');
33
const { apply } = require('./plugin');
44

55
module.exports = {
6+
apply,
67
name: 'typescript',
78
promptsOptions,
8-
apply,
99
};

‎template/plugins/printSuccess/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const promptsOptions = require('./_prompts');
33
const { apply } = require('./plugin');
44

55
module.exports = {
6+
apply,
67
name: 'printSuccess',
78
promptsOptions,
8-
apply,
99
};

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /