-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add eslint-plugin-react to handle jsx-sort-props
- Loading branch information
1 parent
1615593
commit a42a7e2
Showing
4 changed files
with
4,968 additions
and
3,242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
module.exports = { | ||
root: true, | ||
env: { browser: true, es2020: true }, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:react-hooks/recommended', | ||
], | ||
ignorePatterns: ['dist', '.eslintrc.cjs'], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['react-refresh'], | ||
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:react-hooks/recommended"], | ||
ignorePatterns: ["node_modules", "dist", ".eslintrc.cjs"], | ||
parser: "@typescript-eslint/parser", | ||
plugins: ["react-refresh", "react"], | ||
rules: { | ||
'react-refresh/only-export-components': [ | ||
'warn', | ||
{ allowConstantExport: true }, | ||
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }], | ||
"@typescript-eslint/no-explicit-any": ["off"], | ||
"react/jsx-sort-props": [ | ||
"warn", | ||
{ | ||
callbacksLast: true, | ||
shorthandFirst: true, | ||
ignoreCase: true, | ||
noSortAlphabetically: false, // when true, alphabetical order is not enforced | ||
reservedFirst: true, // react reserved props (children, dangerouslySetInnerHTML, key...) must be listed before all other props | ||
multiline: "last", // 'ignore' | 'first' | 'last' | ||
}, | ||
], | ||
'@typescript-eslint/no-explicit-any': ['off'], | ||
} | ||
} | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.