Socket
Book a DemoInstallSign in
Socket

@criptext/criptext-js-tools

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@criptext/criptext-js-tools

JS tools used by Criptext

latest
npmnpm
Version
0.5.2
Version published
Maintainers
1
Created
Source

Criptext JS Tools

Lint and format JS code with zero configuration.

Install

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"
  },

Scripts

Lint

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.

Format

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.

Test

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.

Integration

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

Package last updated on 19 Nov 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.