Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: standard/eslint-config-standard
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3f4a3fed2c5d5fdf03e5c32e6c87d2fdc3ea4282
Choose a base ref
...
head repository: standard/eslint-config-standard
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2cfcbfd91bb20f3479cd0e9b425324746eb3554b
Choose a head ref
Loading
Showing with 80 additions and 39 deletions.
  1. +1 −1 README.md
  2. +47 −19 eslintrc.json
  3. +1 −0 index.js
  4. +24 −12 package.json
  5. +2 −2 test/basic.js
  6. +5 −5 test/validate-config.js
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@ The above steps will automatically set up an ESLint configuration and install th
**If you want to set up the config manually**, run the following command:

```bash
npm install --save-dev eslint-config-standard eslint-plugin-standard eslint-plugin-promise eslint-plugin-import eslint-plugin-node
npm install --save-dev eslint-config-standard eslint-plugin-promise eslint-plugin-import eslint-plugin-node
```

Then, add this to your `.eslintrc` file:
66 changes: 47 additions & 19 deletions eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
{
"parserOptions": {
"ecmaVersion": 2020,
"ecmaVersion": 2021,
"ecmaFeatures": {
"jsx": true
},
"sourceType": "module"
},

"env": {
"es6": true,
"es2021": true,
"node": true
},

"plugins": [
"import",
"node",
"promise",
"standard"
"promise"
],

"globals": {
@@ -26,12 +25,22 @@
},

"rules": {
"accessor-pairs": "error",
"no-var": "warn",

"accessor-pairs": ["error", { "setWithoutGet": true, "enforceForClassMembers": true }],
"array-bracket-spacing": ["error", "never"],
"array-callback-return": ["error", {
"allowImplicit": false,
"checkForEach": false
}],
"arrow-spacing": ["error", { "before": true, "after": true }],
"block-spacing": ["error", "always"],
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"camelcase": ["error", { "properties": "never" }],
"camelcase": ["error", {
"allow": ["^UNSAFE_"],
"properties": "never",
"ignoreGlobals": true
}],
"comma-dangle": ["error", {
"arrays": "never",
"objects": "never",
@@ -41,16 +50,16 @@
}],
"comma-spacing": ["error", { "before": false, "after": true }],
"comma-style": ["error", "last"],
"computed-property-spacing": ["error", "never"],
"computed-property-spacing": ["error", "never", { "enforceForClassMembers": true }],
"constructor-super": "error",
"curly": ["error", "multi-line"],
"default-case-last": "error",
"dot-location": ["error", "property"],
"dot-notation": ["error", { "allowKeywords": true }],
"eol-last": "error",
"eqeqeq": ["error", "always", { "null": "ignore" }],
"func-call-spacing": ["error", "never"],
"generator-star-spacing": ["error", { "before": true, "after": true }],
"handle-callback-err": ["error", "^(err|error)$" ],
"indent": ["error", 2, {
"SwitchCase": 1,
"VariableDeclarator": 1,
@@ -64,11 +73,13 @@
"ImportDeclaration": 1,
"flatTernaryExpressions": false,
"ignoreComments": false,
"ignoredNodes": ["TemplateLiteral *"]
"ignoredNodes": ["TemplateLiteral *", "JSXElement", "JSXElement > *", "JSXAttribute", "JSXIdentifier", "JSXNamespacedName", "JSXMemberExpression", "JSXSpreadAttribute", "JSXExpressionContainer", "JSXOpeningElement", "JSXClosingElement", "JSXFragment", "JSXOpeningFragment", "JSXClosingFragment", "JSXText", "JSXEmptyExpression", "JSXSpreadChild"],
"offsetTernaryExpressions": true
}],
"key-spacing": ["error", { "beforeColon": false, "afterColon": true }],
"keyword-spacing": ["error", { "before": true, "after": true }],
"lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }],
"multiline-ternary": ["error", "always-multiline"],
"new-cap": ["error", { "newIsCap": true, "capIsNew": false, "properties": true }],
"new-parens": "error",
"no-array-constructor": "error",
@@ -87,6 +98,8 @@
"no-dupe-class-members": "error",
"no-dupe-keys": "error",
"no-duplicate-case": "error",
"no-useless-backreference": "error",
"no-empty": ["error", { "allowEmptyCatch": true }],
"no-empty-character-class": "error",
"no-empty-pattern": "error",
"no-eval": "error",
@@ -100,12 +113,13 @@
"no-func-assign": "error",
"no-global-assign": "error",
"no-implied-eval": "error",
"no-inner-declarations": ["error", "functions"],
"no-import-assign": "error",
"no-invalid-regexp": "error",
"no-irregular-whitespace": "error",
"no-iterator": "error",
"no-labels": ["error", { "allowLoop": false, "allowSwitch": false }],
"no-lone-blocks": "error",
"no-loss-of-precision": "error",
"no-misleading-character-class": "error",
"no-prototype-builtins": "error",
"no-useless-catch": "error",
@@ -121,17 +135,14 @@
"no-multi-spaces": "error",
"no-multi-str": "error",
"no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 0 }],
"no-negated-in-lhs": "error",
"no-new": "error",
"no-new-func": "error",
"no-new-object": "error",
"no-new-require": "error",
"no-new-symbol": "error",
"no-new-wrappers": "error",
"no-obj-calls": "error",
"no-octal": "error",
"no-octal-escape": "error",
"no-path-concat": "error",
"no-proto": "error",
"no-redeclare": ["error", { "builtinGlobals": false }],
"no-regex-spaces": "error",
@@ -152,10 +163,20 @@
"no-unmodified-loop-condition": "error",
"no-unneeded-ternary": ["error", { "defaultAssignment": false }],
"no-unreachable": "error",
"no-unreachable-loop": "error",
"no-unsafe-finally": "error",
"no-unsafe-negation": "error",
"no-unused-expressions": ["error", { "allowShortCircuit": true, "allowTernary": true, "allowTaggedTemplates": true }],
"no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": true }],
"no-unused-expressions": ["error", {
"allowShortCircuit": true,
"allowTernary": true,
"allowTaggedTemplates": true
}],
"no-unused-vars": ["error", {
"args": "none",
"caughtErrors": "none",
"ignoreRestSiblings": true,
"vars": "all"
}],
"no-use-before-define": ["error", { "functions": false, "classes": false, "variables": false }],
"no-useless-call": "error",
"no-useless-computed-key": "error",
@@ -174,6 +195,7 @@
"padded-blocks": ["error", { "blocks": "never", "switches": "never", "classes": "never" }],
"prefer-const": ["error", {"destructuring": "all"}],
"prefer-promise-reject-errors": "error",
"prefer-regex-literals": ["error", { "disallowRedundantWrapping": true }],
"quote-props": ["error", "as-needed"],
"quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": false }],
"rest-spread-spacing": ["error", "never"],
@@ -192,7 +214,10 @@
"template-curly-spacing": ["error", "never"],
"template-tag-spacing": ["error", "never"],
"unicode-bom": ["error", "never"],
"use-isnan": "error",
"use-isnan": ["error", {
"enforceForSwitchCase": true,
"enforceForIndexOf": true
}],
"valid-typeof": ["error", { "requireStringLiterals": true }],
"wrap-iife": ["error", "any", { "functionPrototypeMethods": true }],
"yield-star-spacing": ["error", "both"],
@@ -205,11 +230,14 @@
"import/no-named-default": "error",
"import/no-webpack-loader-syntax": "error",

"node/handle-callback-err": ["error", "^(err|error)$" ],
"node/no-callback-literal": "error",
"node/no-deprecated-api": "error",
"node/no-exports-assign": "error",
"node/no-new-require": "error",
"node/no-path-concat": "error",
"node/process-exit-as-throw": "error",

"promise/param-names": "error",

"standard/no-callback-literal": "error"
"promise/param-names": "error"
}
}
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/*! eslint-config-standard. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
module.exports = require('./eslintrc.json')
36 changes: 24 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "eslint-config-standard",
"description": "JavaScript Standard Style - ESLint Shareable Config",
"version": "14.1.1",
"version": "16.0.3",
"author": {
"name": "Feross Aboukhadijeh",
"email": "feross@feross.org",
@@ -11,12 +11,11 @@
"url": "https://github.com/standard/eslint-config-standard/issues"
},
"devDependencies": {
"eslint": "^6.2.2",
"eslint-plugin-import": "^2.18.0",
"eslint-plugin-node": "^10.0.0",
"eslint": "^7.12.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.0",
"tape": "^4.8.0"
"tape": "^5.0.1"
},
"homepage": "https://github.com/standard/eslint-config-standard",
"keywords": [
@@ -48,11 +47,10 @@
"license": "MIT",
"main": "index.js",
"peerDependencies": {
"eslint": ">=6.2.2",
"eslint-plugin-import": ">=2.18.0",
"eslint-plugin-node": ">=9.1.0",
"eslint-plugin-promise": ">=4.2.1",
"eslint-plugin-standard": ">=4.0.0"
"eslint": "^7.12.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1 || ^5.0.0"
},
"repository": {
"type": "git",
@@ -61,5 +59,19 @@
"scripts": {
"lint": "eslint . --config=eslintrc.json",
"test": "npm run lint && tape test/*.js"
}
},
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
]
}
4 changes: 2 additions & 2 deletions test/basic.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var config = require('../')
var test = require('tape')
const config = require('../')
const test = require('tape')

test('test basic properties of config', function (t) {
t.ok(isObject(config.parserOptions))
10 changes: 5 additions & 5 deletions test/validate-config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
var eslint = require('eslint')
var test = require('tape')
const eslint = require('eslint')
const test = require('tape')

test('load config in eslint to validate all rule syntax is correct', function (t) {
var CLIEngine = eslint.CLIEngine
const CLIEngine = eslint.CLIEngine

var cli = new CLIEngine({
const cli = new CLIEngine({
useEslintrc: false,
configFile: 'eslintrc.json'
})

var code = 'var foo = 1\nvar bar = function () {}\nbar(foo)\n'
const code = 'const foo = 1\nconst bar = function () {}\nbar(foo)\n'

t.equal(cli.executeOnText(code).errorCount, 0)
t.end()