![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
@practio/eslint-config-practio
Advanced tools
Global eslint config for all Practio repos
In order to use this config in your project do the following:
Install this module:
$ npm i -D @practio/eslint-config-practio
After that create a file called .eslintrc.json
in the root of the project with the following content:
{
"extends": ["@practio/practio"]
}
First start by ensuring you have completed the steps in the Usage section of this readme before you continue.
Then install the modules needed for the formatting script and commit hook:
$ npm i -D husky lint-staged
Then add the following scripts to the package.json file of your project (notice that the format
script is also calling a prettier:write
script, see the prettier-config repo on how to add it):
{
"scripts": {
// ...
"eslint:fix": "eslint --fix . || echo Unfixable errors were ignored and should be caught by the tests",
"format": "npm run eslint:fix && npm run prettier:write"
}
}
Install lint-staged as a dev dependency and add the following entry to the root of the package.json file:
{
"lint-staged": {
"*.@(js|jsx|ts|mjs)": ["eslint --fix"]
}
}
Next install husky as a dev dependency and add a pre-commit hook by using the npx husky add
command (see their docs). In the pre-commit
file inside the .husky
folder add the following line npx --no lint-staged
.
You have now added a format
script that can be executed in order to format the whole repository (for repositories that are merged with ready builds on Circle-CI, the merge script of ci-merge tries to run the script format
if one is defined in package.json).
You have also added a commit hook that ensures that all files that you make changes to will be linted and auto fixed when they are staged with git.
If you need the formatting to ignore some specific folders (for example coverage, build or dist folders) then add a .prettierignore
and a .eslintignore
file to the root of the repository and add the globs that needs to be ignored to both files (it uses gitignore syntax).
That's it. Next time you make changes to your code, it will be formatted automatically as well.
Most editors have extensions for eslint that allows for highlighting of linting errors while you code. It is recommnded that you install such an extention in your editor. Normally, those extensions should automatically register and use the .eslintrc.json
file you added in the Usage section. You can also enable the extension "Auto fix on save" option to have most linting errors fixed automatically.
All project's should normally also include an automatted test that ensures the the linting rules are respected. To do this for Mocha tests then start by installing the following module:
$ npm i -D mocha-eslint
Then add the test file called eslint.test.js
to the folder containing your mocha tests. The content of the file should be:
require('mocha-eslint')(['.']);
That's it. Now the linting will also be checked as part of your tests.
FAQs
Global eslint config for all Practio repos
The npm package @practio/eslint-config-practio receives a total of 0 weekly downloads. As such, @practio/eslint-config-practio popularity was classified as not popular.
We found that @practio/eslint-config-practio demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 13 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.