Enable lint/sort-imports everywhere (#41333)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41333

Enables the `sort-imports` lint rule introduced in D39907799 in ~all files, rather than just in `react-native/Libraries`.

We exclude only `packages/react-native/template`, in order to (1) minimise noise for projects that are tracking updates to the template, (2) avoid the possibility of something breaking if the `react-native` import isn't at the top of `template/index.js`, (3) avoid leaking a reference to `lint/sort-imports` to the template (which doesn't ship with this rule) via an ESLint suppression comment.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D51025811

fbshipit-source-id: a62b0d6ebc5323116a4b2f1b69c4e8d48cde3215
This commit is contained in:
Moti Zilberman 2023-11-06 12:59:38 -08:00 коммит произвёл Facebook GitHub Bot
Родитель 1e21e34695
Коммит fda7d69b38
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -34,6 +34,13 @@ module.exports = {
'no-undef': 0,
},
},
{
files: ['*.js', '*.js.flow'],
excludedFiles: ['packages/react-native/template/**/*'],
rules: {
'lint/sort-imports': 1,
},
},
{
files: ['package.json'],
parser: 'jsonc-eslint-parser',
@ -60,7 +67,6 @@ module.exports = {
'lint/no-haste-imports': 2,
'lint/no-react-native-imports': 2,
'lint/require-extends-error': 2,
'lint/sort-imports': 1,
},
},
{