
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
@criptext/criptext-js-tools
Advanced tools
Lint and format JS code with zero configuration.
yarn add --dev criptext-js-tools
Then add these lines to your package.json
:
"scripts": {
+ "lint": "criptext-js-tools lint",
+ "test": "criptext-js-tools test"
},
This will format your js files with prettier, and then check them with eslint. Only files inside src
will be processed. On a CI environment, no files are modified, instead, when unformatted files are found, an error detailing the filepaths is thrown.
The rules used depend on your project. If your project lists 'react-dom' as a dependency, it is considered a 'frontend' project and eslint-plugin-react's recommended rules are added.
This script takes a file name as parameter and source code via STDIN, and it will format the source code with Prettier and print it to STDOUT. For example you can call it like this:
cat foo.js > criptext-js-tools foo.js
This is useful fo editor plugins that run external commands to format the current buffer. Please note that it is not necessary to pass the actual file name as parameter, as long as the extension is correct, Prettier will be able to figure out which parser it should use.
This will look for unit test files and runs them in parallel with Jest. The pattern used to match test files is Jest's default:
By default it looks for .js and .jsx files inside of tests folders, as well as any files with a suffix of .test or .spec (e.g. Component.test.js or Component.spec.js). It will also find files called test.js or spec.js.
Any command line arguments that you pass to this script will be directly forwarded to Jest.
This also runs tests with Jest, but it uses a different pattern for matching tests and runs them sequentially (using --runInBand
). This script matches any file that ends in .integration.js
. Without parallelization the test suite is slower but it is useful for testing how well your program integrates with stateful external elements like databases.
FAQs
JS tools used by Criptext
We found that @criptext/criptext-js-tools demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.