Skip to content

Commit 0928c4d

Browse files
authored
chore: some eslint fixes (NativeScript#9178)
* add `eslint-plugin-prettier` so that eslint can format code too * fixed eslint config file: - wrong “prettier” extend - added config for eslint/prettier * allow eslint/prettier to format JSON files except package.json files (which are formatted by npm)
1 parent c47b974 commit 0928c4d

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.eslintrc.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,15 @@
77
"project": ["packages/core/tsconfig.json", "packages/webpack/tsconfig.json"]
88
},
99
"ignorePatterns": ["**/*"],
10-
"plugins": ["@typescript-eslint", "@nrwl/nx"],
11-
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier", "prettier/@typescript-eslint"],
10+
"plugins": ["prettier", "@typescript-eslint", "@nrwl/nx"],
11+
"extends": [
12+
"eslint:recommended",
13+
"plugin:@typescript-eslint/recommended",
14+
"prettier/@typescript-eslint",
15+
"plugin:prettier/recommended"
16+
],
1217
"rules": {
18+
"prettier/prettier": "warn",
1319
"@typescript-eslint/explicit-member-accessibility": "off",
1420
"@typescript-eslint/explicit-function-return-type": "off",
1521
"@typescript-eslint/no-parameter-properties": "off",

.prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ packages/ui-mobile-base
1616
tools/assets/App_Resources
1717
*.cmd
1818
*.md
19-
*.json
19+
package.json
2020
*.js
2121
*.map
2222
*.css

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"dotenv": "~8.2.0",
3939
"eslint": "~7.10.0",
4040
"eslint-config-prettier": "~6.11.0",
41+
"eslint-plugin-prettier": "^3.3.1",
4142
"gonzales": "^1.0.7",
4243
"husky": "^4.2.5",
4344
"jest": "~26.2.2",

0 commit comments

Comments
 (0)