⬆️ Upgrade prettier to 2.3.2 + modify editorconfig

* Remove the 1000 max_width rule in editorconfig which is obsolete since
  prettier 2.3.2 has fixed the key-wrapping problem.
* Let prettier run on yaml files (notably modele-social, but not the translation
  files).
* Simplify editorconfig file.
* Let editorconfig trim trailing whitespaces in yaml files, but ignore locale
  yaml files.
* Allow prettier on publicodes.
pull/1667/head
Alexandre Hajjar 2021-07-01 18:25:50 +02:00
parent 5dfe3185f4
commit d3c866daa5
5 changed files with 1777 additions and 94 deletions

View File

@ -8,24 +8,18 @@ trim_trailing_whitespace = true
# tab_width doesn't make much sense as it can be left to the reader to decide.
indent_style = tab
insert_final_newline = true
max_line_length = 80
[**.{js,jsx,ts,tsx}]
indent_size = 2
max_line_length = 80
[**.{yml,yaml}]
# Spaces are mandatory for yaml files:
indent_style = space
indent_size = 2
# A high max_line_length is needed as prettier doesn't manage property-name
# line-wrapping correctly:
# See https://github.com/prettier/prettier/issues/5599
max_line_length = 1000
trim_trailing_whitespace = false
[*.md]
trim_trailing_whitespace = false
indent_style = space
indent_size = 4
trim_trailing_whitespace = false

View File

@ -1,3 +1,3 @@
.eslintrc.js
dist
publicodes
mon-entreprise/source/locales/*.yaml

View File

@ -0,0 +1,7 @@
[*.yaml]
indent_style = unset
indent_size = unset
end_of_line = unset
insert_final_newline = unset
max_line_length = unset
trim_trailing_whitespace = unset

View File

@ -84,7 +84,7 @@
"mock-local-storage": "^1.0.5",
"nearley-loader": "^2.0.0",
"postcss-loader": "^2.1.2",
"prettier": "^2.2.1",
"prettier": "^2.3.2",
"raw-loader": "^0.5.1",
"react-hot-loader": "^4.12.15",
"rimraf": "^3.0.2",
@ -112,7 +112,7 @@
"lint:eslintrc": "eslint --print-config .eslintrc.js | eslint-config-prettier-check",
"lint:eslint": "export NODE_OPTIONS='--max-old-space-size=4096'; eslint . --ext .js,.jsx,.ts,.tsx",
"lint:eslint:fix": "yarn lint:eslint --fix",
"lint:prettier": "yarn run prettier --check \"**/*.{js,jsx,ts,tsx}\"",
"lint:prettier": "yarn run prettier --check \"**/*.{js,jsx,ts,tsx,yaml,yml}\"",
"lint:prettier:fix": "yarn lint:prettier --write",
"lint:fix": "yarn lint:eslint:fix && yarn lint:prettier:fix",
"prepare": "if [ -z \"$NETLIFY\" ]; then yarn workspaces run prepare; fi",

1848
yarn.lock

File diff suppressed because it is too large Load Diff