Skip to content

Commit

Permalink
style(lint): replace eslint-plugin-xo
Browse files Browse the repository at this point in the history
eslint-plugin-xo has been deprecated in favor of eslint-plugin-unicorn, which
I replaced and configured.

Also ran npm dedupe.

#44,#187
  • Loading branch information
gregswindle committed Jan 15, 2018
1 parent 469b462 commit 8df0000
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 190 deletions.
30 changes: 21 additions & 9 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ plugins:
# - # scanjs-rules
- security
- standard
- xo
- unicorn
- xss
extends:
- eslint:all
Expand Down Expand Up @@ -491,15 +491,27 @@ rules:
security/detect-possible-timing-attacks: error
security/detect-pseudoRandomBytes: error
security/detect-unsafe-regex: error
xo/catch-error-name:
# eslint-plugin-unicorn rules
# @see https://github.com/sindresorhus/eslint-plugin-unicorn
unicorn/catch-error-name:
- error
- name: err
xo/explicit-length-check: error
xo/filename-case:
unicorn/custom-error-definition: error
unicorn/escape-case: error
unicorn/explicit-length-check: error
unicorn/filename-case:
- error
- case: kebabCase
xo/no-abusive-eslint-disable: error
xo/no-process-exit: error
xo/throw-new-error: error
xss/no-location-href-assign: off
xss/no-mixed-html: off
unicorn/import-index: error
unicorn/new-for-builtins: error
unicorn/no-abusive-eslint-disable: error
unicorn/no-array-instanceof: error
unicorn/no-fn-reference-in-iterator: error
unicorn/no-hex-escape: error
unicorn/no-new-buffer: error
unicorn/no-process-exit: error
unicorn/number-literal-case: error
unicorn/prefer-starts-ends-with: error
unicorn/prefer-type-error: error
unicorn/regex-shorthand: error
unicorn/throw-new-error: error
28 changes: 19 additions & 9 deletions lib/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"promise",
"security",
"standard",
"xo",
"unicorn",
"xss"
],
"extends": [
Expand Down Expand Up @@ -547,23 +547,33 @@
"security/detect-possible-timing-attacks": "error",
"security/detect-pseudoRandomBytes": "error",
"security/detect-unsafe-regex": "error",
"xo/catch-error-name": [
"unicorn/catch-error-name": [
"error",
{
"name": "err"
}
],
"xo/explicit-length-check": "error",
"xo/filename-case": [
"unicorn/custom-error-definition": "error",
"unicorn/escape-case": "error",
"unicorn/explicit-length-check": "error",
"unicorn/filename-case": [
"error",
{
"case": "kebabCase"
}
],
"xo/no-abusive-eslint-disable": "error",
"xo/no-process-exit": "error",
"xo/throw-new-error": "error",
"xss/no-location-href-assign": false,
"xss/no-mixed-html": false
"unicorn/import-index": "error",
"unicorn/new-for-builtins": "error",
"unicorn/no-abusive-eslint-disable": "error",
"unicorn/no-array-instanceof": "error",
"unicorn/no-fn-reference-in-iterator": "error",
"unicorn/no-hex-escape": "error",
"unicorn/no-new-buffer": "error",
"unicorn/no-process-exit": "error",
"unicorn/number-literal-case": "error",
"unicorn/prefer-starts-ends-with": "error",
"unicorn/prefer-type-error": "error",
"unicorn/regex-shorthand": "error",
"unicorn/throw-new-error": "error"
}
}
30 changes: 21 additions & 9 deletions lib/.eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ plugins:
# - # scanjs-rules
- security
- standard
- xo
- unicorn
- xss
extends:
- eslint:all
Expand Down Expand Up @@ -491,15 +491,27 @@ rules:
security/detect-possible-timing-attacks: error
security/detect-pseudoRandomBytes: error
security/detect-unsafe-regex: error
xo/catch-error-name:
# eslint-plugin-unicorn rules
# @see https://github.com/sindresorhus/eslint-plugin-unicorn
unicorn/catch-error-name:
- error
- name: err
xo/explicit-length-check: error
xo/filename-case:
unicorn/custom-error-definition: error
unicorn/escape-case: error
unicorn/explicit-length-check: error
unicorn/filename-case:
- error
- case: kebabCase
xo/no-abusive-eslint-disable: error
xo/no-process-exit: error
xo/throw-new-error: error
xss/no-location-href-assign: off
xss/no-mixed-html: off
unicorn/import-index: error
unicorn/new-for-builtins: error
unicorn/no-abusive-eslint-disable: error
unicorn/no-array-instanceof: error
unicorn/no-fn-reference-in-iterator: error
unicorn/no-hex-escape: error
unicorn/no-new-buffer: error
unicorn/no-process-exit: error
unicorn/number-literal-case: error
unicorn/prefer-starts-ends-with: error
unicorn/prefer-type-error: error
unicorn/regex-shorthand: error
unicorn/throw-new-error: error
1 change: 1 addition & 0 deletions lib/formatters/crc/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const {template} = require("lodash");
* @private
*/

// eslint-disable-next-line security/detect-non-literal-fs-filename
const getTempate = (templateName) => template(fs.readFileSync(path.join(
__dirname,
templateName
Expand Down

0 comments on commit 8df0000

Please sign in to comment.