Skip to content

Commit

Permalink
Enable lint/sort-imports everywhere (facebook#41333)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#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
  • Loading branch information
motiz88 authored and facebook-github-bot committed Nov 6, 2023
1 parent 1e21e34 commit fda7d69
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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,
},
},
{
Expand Down

0 comments on commit fda7d69

Please sign in to comment.