1.0.0 • Published 4 years ago

@tonicplatforms/eslint-plugin v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

eslint-plugin

npm package node version

Tonic's ESLint plugins and rules for Node.js applications.

Install + Build

Most ESLint plugins (including this one) require ESLint to be installed as a peer dependency. Tonic currently supports eslint ^6.8.0.

$ npm install eslint
$ npm install @tonicplatforms/eslint-plugin

You can then run ESLint using npx:

$ npx eslint . --ext js

Docs

Tonic's ESLint plugin exports the following configurations:

node

Use this for apps that will run in the Node.js runtime. This configuration allows ESNext syntax and Node.js built-in APIs available with the ^12.6.2 LTS release, including a preference for ES modules. Extend your .eslintrc.json file to include the @tonicplatforms/node configuration:

{
  "extends": [
    "plugin:@tonicplatforms/node"
  ]
}

To enable support for ES modules and default path resolution for .js files, make sure to set your package.json type to module and use the experimental modules and experimental specifier resolution flags when running your app:

{
  "type": "module"
}
$ node --experimental-modules --experimental-specifier-resolution=node index

NOTE: We use the babel-eslint parser to support ES2020 and experimental syntax. Although most unsupported ES/Node.js features will be rejected, ES2020 introduced optional chaining (?.) and nullish coalescing (??) which are not yet supported natively in Node.js ^12.6.2, however are parsed without errors by babel-eslint. DO NOT USE these operators unless your code is transpiled.

License

MIT © Tonic Platforms