https://github.com/gavinbirkhoff/cleanness
A collection of configuration files containing prettier, eslint, stylelint, and cli
https://github.com/gavinbirkhoff/cleanness
Last synced: about 1 year ago
JSON representation
A collection of configuration files containing prettier, eslint, stylelint, and cli
- Host: GitHub
- URL: https://github.com/gavinbirkhoff/cleanness
- Owner: GavinBirkhoff
- License: mit
- Created: 2022-04-05T13:01:14.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-01-19T11:34:19.000Z (over 3 years ago)
- Last Synced: 2025-01-25T05:14:19.672Z (over 1 year ago)
- Language: TypeScript
- Size: 34.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cleanness
A collection of configuration files containing prettier, eslint, stylelint, and cli. thank umi.
# Use
安装
```bash
npm i cleanness --save-dev
yarn add cleanness -D
```
Command to initialize related files
```
cleanness init
```
or Manually add related files
in `.eslintrc.js`
```js
module.exports = {
extends: [require.resolve('cleanness/dist/eslint')],
// in antd-design-pro
globals: {
ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: true,
REACT_APP_ENV: true, // in umi
page: true,
},
rules: {
// your rules
},
}
```
in `.stylelintrc.js`
```js
module.exports = {
extends: [require.resolve('cleanness/dist/stylelint')],
rules: {
// your rules
},
}
```
in `.prettierrc.js`
```js
const cleanness = require('cleanness')
module.exports = {
...cleanness.prettier,
}
```
or Add a .cleanness.config.js to your root
```js
//.cleanness.config.js
module.exports = {
// open cleanness verify
strict: true,
// User-defined verification rules
verify:
/^(((\ud83c[\udf00-\udfff])|(\ud83d[\udc00-\ude4f\ude80-\udeff])|[\u2600-\u2B55]) )?(revert: )?(feat|fix|docs|UI|refactor|perf|workflow|build|CI|typos|chore|tests|types|wip|release|dep|locale)(\(.+\))?: .{1,50}/,
// call it when verify was failed
verifyMsg: function (locale) {
// locale
// echo log
},
}
```