-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Proposal: Apply prettier on the whole project files (#313)
## 📜 Description This is a proposal. When I'm working on the repository, I notice that the formatter (prettier) update some part of the files even if I don't changed them. This occurs because some files are not formatted with it, this PR add a new npm command (`format`) and run it. I know that this is a lot of changes (especially in the docs markdown files), feels free to close the PR if you don't want to deal with this. ## 💡 Motivation and Context This simplifies collaboration on the project, can even been run on commit using `lint-staged`. --------- Co-authored-by: kirillzyusko <[email protected]>
- Loading branch information
1 parent
97e9c8f
commit b6d2ca8
Showing
325 changed files
with
4,154 additions
and
3,764 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,102 +1,92 @@ | ||
module.exports = { | ||
root: true, | ||
plugins: ['@typescript-eslint', 'react', 'react-native', 'jest', 'import'], | ||
plugins: ["@typescript-eslint", "react", "react-native", "jest", "import"], | ||
extends: [ | ||
'@react-native', | ||
'prettier', | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:jest/recommended', | ||
'plugin:import/typescript', | ||
"@react-native", | ||
"prettier", | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:jest/recommended", | ||
"plugin:import/typescript", | ||
], | ||
settings: { | ||
'import/parsers': { | ||
'@typescript-eslint/parser': ['.ts', '.tsx'], | ||
"import/parsers": { | ||
"@typescript-eslint/parser": [".ts", ".tsx"], | ||
}, | ||
'import/resolver': { | ||
"import/resolver": { | ||
typescript: { | ||
alwaysTryTypes: true, | ||
project: '<root>/tsconfig.json', | ||
project: "<root>/tsconfig.json", | ||
}, | ||
}, | ||
}, | ||
rules: { | ||
'prettier/prettier': [ | ||
'error', | ||
"prettier/prettier": [ | ||
"error", | ||
{ | ||
quoteProps: 'consistent', | ||
singleQuote: true, | ||
tabWidth: 2, | ||
trailingComma: 'es5', | ||
useTabs: false, | ||
quoteProps: "consistent", | ||
trailingComma: "all", | ||
}, | ||
], | ||
// react | ||
'react-hooks/exhaustive-deps': 'warn', | ||
"react-hooks/exhaustive-deps": "warn", | ||
// typescript | ||
'@typescript-eslint/consistent-type-imports': [ | ||
'error', | ||
{ prefer: 'type-imports' }, | ||
"@typescript-eslint/consistent-type-imports": [ | ||
"error", | ||
{ prefer: "type-imports" }, | ||
], | ||
'@typescript-eslint/no-var-requires': 'warn', | ||
"@typescript-eslint/no-var-requires": "warn", | ||
// import | ||
'sort-imports': [ | ||
'error', | ||
"sort-imports": [ | ||
"error", | ||
{ | ||
// sort destructure imports | ||
ignoreCase: false, | ||
ignoreDeclarationSort: true, | ||
ignoreMemberSort: false, | ||
memberSyntaxSortOrder: ['none', 'all', 'single', 'multiple'], | ||
memberSyntaxSortOrder: ["none", "all", "single", "multiple"], | ||
allowSeparatedGroups: true, | ||
}, | ||
], | ||
'import/order': [ | ||
'error', | ||
"import/order": [ | ||
"error", | ||
{ | ||
'groups': [ | ||
'builtin', | ||
'external', | ||
'internal', | ||
'parent', | ||
'sibling', | ||
'index', | ||
'type', | ||
"groups": [ | ||
"builtin", | ||
"external", | ||
"internal", | ||
"parent", | ||
"sibling", | ||
"index", | ||
"type", | ||
], | ||
'alphabetize': { | ||
order: 'asc', | ||
"alphabetize": { | ||
order: "asc", | ||
caseInsensitive: true, | ||
}, | ||
'newlines-between': 'always', | ||
"newlines-between": "always", | ||
}, | ||
], | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['src/specs/**'], | ||
files: ["src/specs/**"], | ||
rules: { | ||
'@typescript-eslint/ban-types': [ | ||
'error', | ||
"@typescript-eslint/ban-types": [ | ||
"error", | ||
{ | ||
extendDefaults: true, | ||
types: { | ||
'{}': false, | ||
"{}": false, | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
env: { | ||
'react-native/react-native': true, | ||
'jest/globals': true, | ||
"react-native/react-native": true, | ||
"jest/globals": true, | ||
}, | ||
ignorePatterns: [ | ||
'node_modules/**', | ||
'lib/**', | ||
'example/**', | ||
'FabricExample/**', | ||
'docs/**', | ||
'scripts/**', | ||
], | ||
ignorePatterns: ["node_modules/**", "lib/**", "scripts/**"], | ||
}; |
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
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
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
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
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
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.