Use the standard package for an easier setup
masterstandard package instead. It provides a global Node command line program that you can run directly or add to your npm test script to check your code style quickly.repository·master·Indexed 25 days ago
https://github.com/standard/eslint-config-standardESLint shareable configuration for JavaScript Standard Style. It provides a flat configuration object for advanced users to integrate Standard Style rules, including ECMAScript 2022, JSX support, and plugins such as eslint-plugin-n, eslint-plugin-import, and eslint-plugin-promise.
standard package instead. It provides a global Node command line program that you can run directly or add to your npm test script to check your code style quickly.To use this configuration, install eslint and eslint-config-standard as development dependencies using npm.
npm install --save-dev eslint eslint-config-standardThis package exports a flat ESLint configuration. To use it, import the configuration in your eslint.config.js file and include it in the exported array. You can add your own overrides after the standard configuration object.
const standard = require('eslint-config-standard')
module.exports = [
standard,
{
// your overrides here
}
]The eslint-config-standard package exports a Flat Config object compatible with ESLint's new configuration system. You can import it directly into your eslint.config.js file to apply the StandardJS ruleset to your project.
This configuration includes:
document, navigator, window).eslint-plugin-n, eslint-plugin-import, and eslint-plugin-promise.If your project uses the standard style, you can include one of these badges in your README to inform users:
Option 1:
[](http://standardjs.com)Option 2:
[](http://standardjs.com)The following rules are defined within the eslint-config-standard configuration. Note that many rules are configured with specific options to enforce the StandardJS style guide.
// Core ESLint Rules (Selected Examples)
'no-var': 'warn',
'object-shorthand': ['warn', 'properties'],
'array-bracket-spacing': ['error', 'never'],
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
'camelcase': ['error', { allow: ['^UNSAFE_'], properties: 'never', ignoreGlobals: true }],
'comma-dangle': ['error', { arrays: 'never', objects: 'never', imports: 'never', exports: 'never', functions: 'never' }],
'indent': ['error', 2, { /* ... extensive JSX/TemplateLiteral exclusions ... */ }],
'quotes': ['error', 'single', { avoidEscape: true, allowTemplateLiterals: false }],
'semi': ['error', 'never'],
// eslint-plugin-import rules
'import/export': 'error',
'import/first': 'error',
'import/no-absolute-path': ['error', { esmodule: true, commonjs: true, amd: false }],
'import/no-duplicates': 'error',
'import/no-named-default': 'error',
'import/no-webpack-loader-syntax': 'error',
// eslint-plugin-n rules
'n/handle-callback-err': ['error', '^(err|error)$'],
'n/no-callback-literal': 'error',
'n/no-deprecated-api': 'error',
'n/no-exports-assign': 'error',
'n/no-new-require': 'error',
'n/no-path-concat': 'error',
'n/process-exit-as-throw': 'error',
// eslint-plugin-promise rules
'promise/param-names': 'error'