Skip to content

Commit

Permalink
- Enhancement [sauron.js] (tighten): Add `unicorn/prefer-number-pro…
Browse files Browse the repository at this point in the history
…perties`

- Enhancement [`great-eye.js`] (tighten): Add `unicorn/unicorn/prefer-set-has`
- Maintenance: 4 sp. for MD files
- npm: Update devDeps./peerDeps.
- npm: Bump to 18.0.0
  • Loading branch information
brettz9 committed Mar 26, 2020
1 parent 22a569c commit 010e88e
Show file tree
Hide file tree
Showing 8 changed files with 193 additions and 199 deletions.
5 changes: 2 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ indent_style = space
indent_size = 2
trim_trailing_whitespace = true

; [app/public/css/**.styl]
; indent_style = tab
; indent_size = 2
[*.md]
indent_size = 4
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ Waiting on https://github.com/standard/eslint-config-standard/pull/160
as would like to remove deprecated rule https://eslint.org/docs/rules/no-negated-in-lhs
-->

## 18.0.0

- Enhancement [`sauron.js`] (tighten): Add `unicorn/prefer-number-properties`
- Enhancement [`great-eye.js`] (tighten): Add `unicorn/unicorn/prefer-set-has`
- Maintenance: 4 sp. for MD files
- npm: Update devDeps./peerDeps.

## 17.5.0

- Enhancement [`index.js`] (loosen): Surface `standard`'s reasonable dropping of
Expand Down
33 changes: 18 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -489,18 +489,18 @@ standards without the undue burden of having to refactor lots of code (which
may not all be under one's control).

- `class-methods-use-this` - Good for new code (though even here may need
disabling). May break existing APIs.
disabling). May break existing APIs.
- `consistent-this` - A good practice, but sometimes, especially with jQuery
or DOM event handlers, and large functions where it can be difficult to
track what a generic `that` is in reference to, `this` may be more clearly
named as the object
or DOM event handlers, and large functions where it can be difficult to
track what a generic `that` is in reference to, `this` may be more clearly
named as the object
- `default-case` - Refactoring code to know whether to throw or silently
ignore requires time.
ignore requires time.
- `max-len` - May require a lot of refactoring.
- `no-alert` - No quick easy replacement yet with poor `dialog` support.
- `no-console` - Useful for debugging (and sometimes for reporting progress)
to have to disable it at every turn and to distract one from actual errors,
even for production.
to have to disable it at every turn and to distract one from actual errors,
even for production.
- `no-empty-function` - Cumbersome to add comments within every no-op.
- `no-shadow` - Can catch errors, but also some work to refactor (See also
section "Rationale for changing required rules' configuration away
Expand All @@ -516,21 +516,23 @@ may not all be under one's control).
may be used within repeating events
- `unicorn/no-fn-reference-in-iterator` - May be cumbersome though does
catch potential problems
- `unicorn/prefer-number-properties` - Good but some refactoring needed (and not
always readily fixable).
- `jsdoc/require-returns` (recommended) - Put in `ash-nazg/sauron` as
it is more than just a consistent styling convention, and it is
not impossible to follow, but a bit difficult. Added `forceRequireReturn`
option to ensure return type considered even if `void`/`undefined`
and added `contexts: ['any']` so it checks virtual functions
(e.g., with `@implements`).
- `jsdoc/require-jsdoc` (recommended) - Imposes a heavy burden on
preexisting large projects (added as "error" in `great-eye.js`);
we have expanded its options there though to check on `ClassDeclaration`,
`ClassExpression`, and `MethodDefinition` in addition to
`FunctionDeclaration`. This may still `FunctionExpression` and
`ArrowFunctionExpression`, and these may admittedly be used on such as
exports, but until the context option discussed at
<https://github.com/gajus/eslint-plugin-jsdoc/issues/384> may be fixed,
that may be too oppressive to impose.
preexisting large projects (added as "error" in `great-eye.js`);
we have expanded its options there though to check on `ClassDeclaration`,
`ClassExpression`, and `MethodDefinition` in addition to
`FunctionDeclaration`. This may still `FunctionExpression` and
`ArrowFunctionExpression`, and these may admittedly be used on such as
exports, but until the context option discussed at
<https://github.com/gajus/eslint-plugin-jsdoc/issues/384> may be fixed,
that may be too oppressive to impose.
- `jsdoc/require-param-name` (recommended): Expanded this to
`contexts: ['any']`; see description for `jsdoc/require-jsdoc`.
- `jsdoc/require-param-type` (recommended): Expanded this to
Expand Down Expand Up @@ -589,6 +591,7 @@ for projects to specify all child types.
add to sauron if demonstrates not to be too oppressive)
- `unicorn/prevent-abbreviations` - Very cumbersome for frequent conventions such
as `e` for `event`
- `unicorn/prefer-set-has` - Very good, but troublesome to refactor.

The `preferredTypes` setting was enabled here for integer/float as it can
be cumbersome for projects to distinguish.
Expand Down
3 changes: 2 additions & 1 deletion great-eye.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ module.exports = {
'sonarjs/cognitive-complexity': 'warn',

'unicorn/prevent-abbreviations': 'error',
'unicorn/expiring-todo-comments': ['warn', {'allowWarningComments': false, 'terms': ['todo']}]
'unicorn/expiring-todo-comments': ['warn', {'allowWarningComments': false, 'terms': ['todo']}],
'unicorn/prefer-set-has': 'error'
}
};
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ module.exports = {
'unicorn/no-unreadable-array-destructuring': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/prefer-exponentiation-operator': 'off',
'unicorn/prefer-number-properties': 'off',
'unicorn/prefer-set-has': 'off',
'unicorn/prefer-string-slice': 'off',
'unicorn/throw-new-error': 'off',

Expand Down
Loading

0 comments on commit 010e88e

Please sign in to comment.