Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#595 release v6.0.2, please ! #596

Closed
jschyz opened this issue Mar 10, 2022 · 5 comments · Fixed by #598
Closed

#595 release v6.0.2, please ! #596

jschyz opened this issue Mar 10, 2022 · 5 comments · Fixed by #598
Assignees
Labels
enhancement 👑 New feature or request

Comments

@jschyz
Copy link

jschyz commented Mar 10, 2022

#595 release v6.0.2, please !

I need to use LintIssue API to implement some custom Rules。

const npmPackageJsonLint = new NpmPackageJsonLint({
  patterns: [root],
  configFile: path.resolve(__dirname, '../config/.npmpackagejsonlintrc.json')
});

npmPackageJsonLint.rules.registerRule([ruleId], [ruleIdPath])

const results = npmPackageJsonLint.lint();

The ruleIdPath Module lacks the LintIssue API

@jschyz
Copy link
Author

jschyz commented Mar 11, 2022

image

npm-package-json-lint.d.ts No type declaration

version: @6.0.1

@tclindner
Copy link
Owner

Hey @jschyz thanks for calling this out. This was never a documented feature and was a private api. I will work tomorrow to try and get this exposed again. Sorry about that. I didn't realize you were using it like this! It is always fun to see what others are doing!

@tclindner tclindner added the enhancement 👑 New feature or request label Mar 11, 2022
@tclindner tclindner self-assigned this Mar 11, 2022
@jschyz
Copy link
Author

jschyz commented Mar 11, 2022

I want to customize the extension rules,For example:

"lint-staged": {
    "**/*.less": "stylelint --syntax less",
    "**/*.{js,jsx,ts,tsx}": "npm run lint-staged:js",
    "**/*.{js,jsx,tsx,ts,less,md,json}": [
      "prettier --write"
    ]
},
"simple-git-hooks": {
    "pre-commit": "pnpm exec lint-staged --concurrent false",
    "commit-msg": "pnpm exec ts-node scripts/verifyCommit.ts $1"
  },

I want to check if the project has lint-staged, simply-Git-hooks attributes;to correct my team for proper execution;

so,want to add custom Rules

@jschyz
Copy link
Author

jschyz commented Mar 11, 2022

image

I found it in the api.d.ts file

@tclindner
Copy link
Owner

Hey @jschyz please let me know if v6.0.2 works for you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 👑 New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants