Browse Source

chore️: add rome format (#38512)

pull/38514/head
afc163 2 years ago
committed by GitHub
parent
commit
4aa7874990
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .husky/.gitignore
  2. 2
      .husky/pre-commit
  3. 8
      package.json
  4. 14
      rome.json
  5. 1
      scripts/check-version-md.js

1
.husky/.gitignore

@ -0,0 +1 @@
_

2
.husky/pre-commit

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/sh
. "$(dirname "$0")/_/husky.sh" . "$(dirname "$0")/_/husky.sh"
npx --no-install pretty-quick --staged npx --no-install lint-staged

8
package.json

@ -81,7 +81,7 @@
"lint:style": "stylelint '{site,components}/**/*.less'", "lint:style": "stylelint '{site,components}/**/*.less'",
"pre-publish": "npm run test-all -- --skip-build", "pre-publish": "npm run test-all -- --skip-build",
"prettier": "prettier -c --write **/*", "prettier": "prettier -c --write **/*",
"pretty-quick": "pretty-quick", "rome:format": "rome format --write .",
"pub": "npm run version && antd-tools run pub", "pub": "npm run version && antd-tools run pub",
"prepublishOnly": "antd-tools run guard", "prepublishOnly": "antd-tools run guard",
"postpublish": "node ./scripts/post-script.js", "postpublish": "node ./scripts/post-script.js",
@ -245,6 +245,7 @@
"jsdom": "^20.0.0", "jsdom": "^20.0.0",
"jsonml.js": "^0.1.0", "jsonml.js": "^0.1.0",
"less-vars-to-js": "^1.3.0", "less-vars-to-js": "^1.3.0",
"lint-staged": "^13.0.3",
"lz-string": "^1.4.4", "lz-string": "^1.4.4",
"mini-css-extract-plugin": "^1.6.2", "mini-css-extract-plugin": "^1.6.2",
"mockdate": "^3.0.0", "mockdate": "^3.0.0",
@ -252,7 +253,6 @@
"prettier": "^2.3.2", "prettier": "^2.3.2",
"prettier-plugin-jsdoc": "^0.4.2", "prettier-plugin-jsdoc": "^0.4.2",
"pretty-format": "^29.0.0", "pretty-format": "^29.0.0",
"pretty-quick": "^3.0.0",
"qs": "^6.10.1", "qs": "^6.10.1",
"rc-footer": "^0.6.6", "rc-footer": "^0.6.6",
"rc-tween-one": "^3.0.3", "rc-tween-one": "^3.0.3",
@ -281,6 +281,7 @@
"remark-preset-lint-recommended": "^6.0.0", "remark-preset-lint-recommended": "^6.0.0",
"remove-files-webpack-plugin": "1.5.0", "remove-files-webpack-plugin": "1.5.0",
"rimraf": "^3.0.0", "rimraf": "^3.0.0",
"rome": "^10.0.1",
"scrollama": "^3.0.0", "scrollama": "^3.0.0",
"semver": "^7.3.5", "semver": "^7.3.5",
"simple-git": "^3.0.0", "simple-git": "^3.0.0",
@ -350,5 +351,8 @@
], ],
"tnpm": { "tnpm": {
"mode": "npm" "mode": "npm"
},
"lint-staged": {
"*.{ts,tsx,js,json,less,md}": "rome format --write"
} }
} }

14
rome.json

@ -0,0 +1,14 @@
{
"formatter": {
"enabled": true,
"ignore": ["./dist/*", "./es/**/*", "./lib/**/*", "_site/**/*"],
"indentStyle": "space",
"lineWidth": 100,
"indentSize": 2
},
"javascript": {
"formatter": {
"quoteStyle": "single"
}
}
}

1
scripts/check-version-md.js

@ -57,7 +57,6 @@ if (changeLog) {
console.log(chalk.blue('[check-version-md]: Check Passed')); console.log(chalk.blue('[check-version-md]: Check Passed'));
console.log('\n'); console.log('\n');
process.exit(0); process.exit(0);
return;
} }
} }
console.log('\n'); console.log('\n');

Loading…
Cancel
Save