Package Exports
- @shinnn/eslint-config
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@shinnn/eslint-config) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@shinnn/eslint-config
shinnn's ESLint sharable config for both client-side and Node.js-based projects
Features
- Enforce tab indents to save file size
- Support ECMAScript 2019 features – optional
catch
binding and JSON superset - Target
.mjs
file extension by default to support ECMAScript modules - Automatically fix errors without explicitly passing a
--fix
flag- On CI environments, this feature is disabled in order to encourage fixing code locally.
- Users still can manually disable it with
--no-fix
flag.
- Automatically ignore generated files, for example paths under
coverage/
,tmp/
anddist/
- Use a beautiful codeframe formatter by default
- Cache results by default to operate only on the changed files
- Allow CLI-friendly
process.exit()
to be used only inside executables
Installation
Install eslint
and this package with npm.
npm install --dev eslint @shinnn/eslint-config
Then add the following configuration to your project's package.json
.
"eslintConfig": {
"extends": "@shinnn"
}
CLI
# No need to explicitly add `--cache`, `--cache-location`, `--ext`, `--fix` and `--format` flags
$ eslint .
API
const {CLIEngine} = require('eslint');
const cli = new CLIEngine({
// For programmatic usage via API and build tool integrations like webpack eslint-loader,
// options for example `fix: true` and `cache: true` are still needed to set them explicitly.
});
cli.executeOnText('var foo=true;'); //=> {results: [ ... ], errorCount: ... }
License
ISC License © 2017 - 2018 Shinnosuke Watanabe