Skip to content

Commit

Permalink
feat: refactored lint-staged package
Browse files Browse the repository at this point in the history
  • Loading branch information
lotyp committed Feb 10, 2023
1 parent 76b6275 commit dc68784
Show file tree
Hide file tree
Showing 18 changed files with 216 additions and 2,093 deletions.
4 changes: 3 additions & 1 deletion .secretlintrc.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
module.exports = {...require('./packages/secretlint-config/index.json')};
module.exports = {
...require('@wayofdev/secretlint-config'),
}
19 changes: 4 additions & 15 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
// const jsConfig = require('./packages/lint-staged-config');
// const ymlConfig = require('./packages/lint-staged-config/yml');
//
// module.exports = {
// // check for credentials
// '*': ['secretlint'],
// ...ymlConfig,
// ...jsConfig,
// // lint and fix changed markdown files
// '*.md': ['prettier --cache --write', 'markdownlint'],
// // lint and fix changed json files
// '*.json': ['prettier --cache --write'],
// };

// @ts-check

/**
Expand All @@ -22,7 +8,7 @@
* {@link https://github.com/okonet/lint-staged#how-to-use-lint-staged-in-a-multi-package-monorepo}
*/

const { concatFilesForPrettier } = require('./lint-staged.common.js')
const { concatFilesForPrettier } = require('@wayofdev/lint-staged-config')

/**
* @type {Record<string, (filenames: string[]) => string | string[] | Promise<string | string[]>>}
Expand All @@ -31,6 +17,9 @@ const rules = {
'**/*.{json,md,mdx,css,html,yml,yaml,scss,ts,js,tsx,jsx,mjs}': filenames => {
return [`prettier --write ${concatFilesForPrettier(filenames)}`]
},
'**/*': filenames => {
return [`secretlint ${concatFilesForPrettier(filenames)}`]
},
}

module.exports = rules
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
"@types/prettier": "^2.7.2",
"@types/shell-quote": "^1.7.1",
"@wayofdev/eslint-config-bases": "workspace:*",
"@wayofdev/lint-staged-config": "workspace:*",
"@wayofdev/secretlint-config": "workspace:*",
"commitizen": "^4.3.0",
"eslint": "^8.33.0",
"husky": "^8.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/commitlint-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ This package should be added to the root of your monorepo, where you have a file
}
```

This extends the `@wayofdev/commitlint-config` configuration and uses its [pre-defined configuration](https://github.com/wayofdev/npm-shareable-configs/blob/master/packages/commitlint-config/src/index.js).
This extends the `@wayofdev/commitlint-config` configuration and uses its [pre-defined configuration](https://github.com/wayofdev/npm-shareable-configs/blob/master/packages/commitlint-config/index.js).

Alternatively the configuration can be defined in a `commitlint.config.js`, `.commitlintrc.js`, `.commitlintrc`, `.commitlintrc.json`, `.commitlintrc.yml` file or a `commitlint` field in `package.json`.

Expand Down
26 changes: 0 additions & 26 deletions packages/jest-config/CHANGELOG.md

This file was deleted.

21 changes: 0 additions & 21 deletions packages/jest-config/LICENSE

This file was deleted.

21 changes: 0 additions & 21 deletions packages/jest-config/LICENSE.md

This file was deleted.

218 changes: 0 additions & 218 deletions packages/jest-config/README.md

This file was deleted.

7 changes: 0 additions & 7 deletions packages/jest-config/jest-preset.js

This file was deleted.

Loading

0 comments on commit dc68784

Please sign in to comment.