Skip to content

Commit

Permalink
chore: config .editorconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
flingyp committed Nov 14, 2023
1 parent 287743c commit 891993f
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 5 deletions.
23 changes: 23 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

# Change these settings to your own preference
indent_style = space
indent_size = 4

[*.{ts,tsx,js,jsx,json,css,scss,yml,yaml,html,vue,md}]
indent_size = 2

[*.md]
trim_trailing_whitespace = false
46 changes: 42 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@

### Config `.eslintrc``.stylelintrc`

```
```json
{
"extends": "@flypeng/eslint-config"
}
```

```
```json
{
"extends": "@flypeng/stylelint-config"
}
```

### Config `.prettierrc` and `.prettierignore`

```
```json
{
"semi": true,
"singleQuote": true,
Expand Down Expand Up @@ -74,7 +74,7 @@
}
```

### Config VSCode
### Config VSCode Settings

Install VSCode **ESLint****Stylelint****Prettier****Prettier ESLint** plugins and create `.vscode/settings.json`

Expand Down Expand Up @@ -110,3 +110,41 @@ Install VSCode **ESLint**、**Stylelint**、**Prettier**、**Prettier ESLint** p
"stylelint.validate": ["css", "less", "scss", "sass", "vue", "postcss"]
}
```

### Config `.editorconfig`

The configuration of.editorconfig is necessary for team development to ensure that the team editor behaves in a consistent style.

```
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
# Change these settings to your own preference
indent_style = space
indent_size = 4
[*.{ts,tsx,js,jsx,json,css,scss,yml,yaml,html,vue,md}]
indent_size = 2
[*.md]
trim_trailing_whitespace = false
```

### VSCode Extensions

- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
- [Stylelint](https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint)
- [Prettier ESLint](https://marketplace.visualstudio.com/items?itemName=rvest.vs-code-prettier-eslint)
- [EditorConfig](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "MIT",
"scripts": {
"lint": "prettier . --write && eslint . && stylelint \"**/*.{css,scss,vue}\"",
"lint:fix": "prettier . --write && eslint . --fix && stylelint . --fix \"**/*.{css,scss,vue}\""
"lint:fix": "prettier . --write && eslint . --fix && stylelint --fix \"**/*.{css,scss,vue}\""
},
"devDependencies": {
"@changesets/cli": "^2.26.2",
Expand Down

0 comments on commit 891993f

Please sign in to comment.