Skip to content

Commit 57bf9e9

Browse files
committed
ESLint error on unsorted object keys and autofix
- sort-keys rule, but with autofix - Autofix supported in scripts and IDE
1 parent 050aaca commit 57bf9e9

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

β€Ž.eslintrc.jsβ€Ž

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ module.exports = {
3838
'.eslintrc.js',
3939
'!/.github'
4040
],
41-
plugins: ['deprecation', 'simple-import-sort', 'typescript-sort-keys'],
41+
plugins: [
42+
'deprecation',
43+
'simple-import-sort',
44+
'sort-keys-fix',
45+
'typescript-sort-keys'
46+
],
4247
rules: {
4348
'@typescript-eslint/explicit-function-return-type': 'off', // Prefer type inference
4449
'@typescript-eslint/explicit-module-boundary-types': 'off', // Prefer type inference
@@ -65,6 +70,7 @@ module.exports = {
6570
'typescript-sort-keys/string-enum': 'error',
6671
'react/react-in-jsx-scope': 'off',
6772
'sort-vars': 'error',
73+
'sort-keys-fix/sort-keys-fix': 'error', // sort-keys with autofix
6874
'@typescript-eslint/no-unused-vars': [
6975
'error',
7076
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' }

β€Žjest/setup.tsβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ jest.mock('@react-native-community/async-storage', () => ({
99
}))
1010
jest.mock('react-native-swipe-gestures', () => null)
1111
jest.mock('@storybook/react-native', () => ({
12-
getStorybookUI: jest.fn(),
1312
addDecorator: jest.fn(),
14-
configure: jest.fn()
13+
configure: jest.fn(),
14+
getStorybookUI: jest.fn()
1515
}))
1616
jest.mock('react-native/Libraries/LogBox/LogBox')
1717

0 commit comments

Comments
Β (0)