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: cloudfour/eslint-config
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v21.1.0
Choose a base ref
...
head repository: cloudfour/eslint-config
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v22.0.0
Choose a head ref

Commits on Jul 7, 2022

  1. Update dependency @changesets/cli to v2.23.1 (#399)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jul 7, 2022
    Copy the full SHA
    8107576 View commit details

Commits on Jul 13, 2022

  1. Update dependency @changesets/cli to v2.23.2 (#400)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jul 13, 2022
    Copy the full SHA
    5d1592d View commit details

Commits on Jul 17, 2022

  1. Copy the full SHA
    76c7e30 View commit details

Commits on Jul 22, 2022

  1. Copy the full SHA
    5284698 View commit details
  2. Copy the full SHA
    65d32f2 View commit details
  3. Update dependency @changesets/cli to v2.24.0 (#404)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jul 22, 2022
    Copy the full SHA
    a4ec41f View commit details

Commits on Jul 25, 2022

  1. Copy the full SHA
    59bd713 View commit details

Commits on Aug 1, 2022

  1. Copy the full SHA
    0e4c1f9 View commit details

Commits on Aug 5, 2022

  1. Copy the full SHA
    3a0231d View commit details

Commits on Aug 14, 2022

  1. Copy the full SHA
    ffe329b View commit details
  2. Copy the full SHA
    c495f9a View commit details

Commits on Aug 25, 2022

  1. Copy the full SHA
    d628c13 View commit details

Commits on Aug 26, 2022

  1. Copy the full SHA
    26accfc View commit details

Commits on Aug 27, 2022

  1. Copy the full SHA
    0fc9ade View commit details

Commits on Sep 26, 2022

  1. Copy the full SHA
    9bef975 View commit details
  2. Copy the full SHA
    ee3a4fa View commit details
  3. Copy the full SHA
    14a2af4 View commit details
  4. Copy the full SHA
    9cc24bd View commit details

Commits on Sep 28, 2022

  1. Copy the full SHA
    4978976 View commit details

Commits on Oct 1, 2022

  1. Copy the full SHA
    6896f81 View commit details
  2. Copy the full SHA
    f17a6f9 View commit details
  3. Copy the full SHA
    1728b8a View commit details

Commits on Oct 8, 2022

  1. Copy the full SHA
    c3eec4c View commit details

Commits on Oct 22, 2022

  1. Copy the full SHA
    79e0f88 View commit details

Commits on Oct 29, 2022

  1. Copy the full SHA
    a7fac37 View commit details

Commits on Nov 1, 2022

  1. Copy the full SHA
    026cffa View commit details
  2. Copy the full SHA
    cf51a4e View commit details

Commits on Nov 6, 2022

  1. Copy the full SHA
    dc8ab37 View commit details

Commits on Nov 8, 2022

  1. Copy the full SHA
    2e57a9d View commit details

Commits on Nov 16, 2022

  1. Copy the full SHA
    cb22c5f View commit details

Commits on Nov 19, 2022

  1. Copy the full SHA
    922a745 View commit details

Commits on Nov 23, 2022

  1. Copy the full SHA
    5c47a82 View commit details

Commits on Dec 3, 2022

  1. Copy the full SHA
    dd59b43 View commit details

Commits on Dec 7, 2022

  1. Copy the full SHA
    f687d43 View commit details

Commits on Dec 8, 2022

  1. Copy the full SHA
    d4f2258 View commit details

Commits on Dec 17, 2022

  1. Copy the full SHA
    6f9995f View commit details

Commits on Dec 18, 2022

  1. Copy the full SHA
    229c64b View commit details
  2. Copy the full SHA
    c7eb3cf View commit details
  3. Copy the full SHA
    c284f22 View commit details

Commits on Dec 19, 2022

  1. Update dependency eslint-plugin-unicorn to v45 (#431)

    Co-authored-by: Scott Vandehey <scott@cloudfour.com>
    Co-authored-by: Caleb Eby <caleb.eby01@gmail.com>
    3 people authored Dec 19, 2022
    Copy the full SHA
    1c1cc37 View commit details

Commits on Dec 31, 2022

  1. Copy the full SHA
    71766d4 View commit details

Commits on Jan 2, 2023

  1. Copy the full SHA
    f80cc43 View commit details

Commits on Jan 15, 2023

  1. Copy the full SHA
    5228205 View commit details

Commits on Jan 29, 2023

  1. Copy the full SHA
    bc5cdfa View commit details

Commits on Jan 30, 2023

  1. Bump json5 from 1.0.1 to 1.0.2 (#444)

    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Jan 30, 2023
    Copy the full SHA
    9021d16 View commit details
  2. Update dependency prettier to v2.8.3 (#443)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    Co-authored-by: Caleb Eby <caleb.eby01@gmail.com>
    renovate[bot] and calebeby authored Jan 30, 2023
    Copy the full SHA
    4c81c4f View commit details
  3. Update dependency typescript to v4.9.5 (#447)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jan 30, 2023
    Copy the full SHA
    8755309 View commit details

Commits on Feb 8, 2023

  1. Copy the full SHA
    f21226c View commit details

Commits on Feb 11, 2023

  1. Copy the full SHA
    111394f View commit details

Commits on Feb 26, 2023

  1. Copy the full SHA
    177ec22 View commit details
Showing with 2,876 additions and 1,761 deletions.
  1. +2 −2 .github/workflows/ci.yml
  2. +2 −2 .github/workflows/release.yml
  3. +62 −0 CHANGELOG.md
  4. +26 −13 fixtures/babel/packages/babel-helper-create-class-features-plugin/src/fields.js
  5. +2 −1 fixtures/babel/packages/babel-plugin-transform-parameters/src/params.js
  6. +38 −19 fixtures/downshift/src/hooks/useCombobox/reducer.js
  7. +44 −22 fixtures/downshift/src/hooks/useSelect/reducer.js
  8. +9 −0 fixtures/eslint/lib/cli-engine/cascading-config-array-factory.js
  9. +41 −4 fixtures/eslint/lib/cli-engine/config-array-factory.js
  10. +11 −0 fixtures/eslint/lib/cli-engine/config-array/ignore-pattern.js
  11. +13 −0 fixtures/eslint/lib/cli-engine/file-enumerator.js
  12. +12 −1 fixtures/eslint/lib/init/config-initializer.js
  13. +15 −6 fixtures/eslint/lib/linter/apply-disable-directives.js
  14. +33 −11 fixtures/eslint/lib/linter/node-event-generator.js
  15. +30 −4 fixtures/eslint/lib/rules/keyword-spacing.js
  16. +31 −8 fixtures/eslint/lib/rules/padding-line-between-statements.js
  17. +15 −4 fixtures/eslint/lib/rules/prefer-arrow-callback.js
  18. +7 −0 fixtures/eslint/lib/rules/require-atomic-updates.js
  19. +199 −105 fixtures/eslint/lib/rules/utils/ast-utils.js
  20. +33 −4 fixtures/eslint/lib/source-code/source-code.js
  21. +8 −0 fixtures/eslint/tools/code-sample-minimizer.js
  22. +1 −1 fixtures/got/source/core/utils/timed-out.ts
  23. +1 −0 fixtures/load-repo.mjs
  24. +6 −3 fixtures/mocha/karma.conf.js
  25. +6 −0 fixtures/mocha/lib/cli/one-and-dones.js
  26. +11 −0 fixtures/mocha/lib/cli/options.js
  27. +1 −0 fixtures/mocha/lib/growl.js
  28. +1 −1 fixtures/mocha/lib/interfaces/common.js
  29. +1 −0 fixtures/mocha/scripts/markdown-magic.config.js
  30. +1 −0 generate-changeset.mjs
  31. +2,184 −1,535 package-lock.json
  32. +15 −15 package.json
  33. +15 −0 src/config.js
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -11,10 +11,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 14
- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 14
node-version: 16
- name: Cache node modules
uses: actions/cache@v3
with:
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -16,10 +16,10 @@ jobs:
# Fetch all git history for correct changelog commits
fetch-depth: 0

- name: Setup Node.js 14.x
- name: Setup Node.js 16.x
uses: actions/setup-node@master
with:
node-version: 14.x
node-version: 16.x

- name: Install Dependencies
run: npm ci
62 changes: 62 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,67 @@
# @cloudfour/eslint-plugin

## 22.0.0

### Major Changes

- [#487](https://github.com/cloudfour/eslint-config/pull/487) [`88ffd72`](https://github.com/cloudfour/eslint-config/commit/88ffd72315f6be0469d440015f45231510586fe8) Thanks [@renovate](https://github.com/apps/renovate)! - Update `eslint-plugin-unicorn` from `v43` to `v47`

**New Rules**

- [`@cloudfour/unicorn/no-negated-condition`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v45.0.0/docs/rules/no-negated-condition.md)
- [`@cloudfour/unicorn/no-typeof-undefined`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v45.0.0/docs/rules/no-typeof-undefined.md)
- [`@cloudfour/unicorn/no-unnecessary-await`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v45.0.0/docs/rules/no-unnecessary-await.md)
- [`@cloudfour/unicorn/prefer-set-size`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v45.0.0/docs/rules/prefer-set-size.md)
- [`@cloudfour/unicorn/switch-case-braces`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v45.0.0/docs/rules/switch-case-braces.md)
- [`@cloudfour/unicorn/prefer-blob-reading-methods`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v47.0.0/docs/rules/prefer-blob-reading-methods.md)

**Newly Enabled Rules**

- [`@cloudfour/unicorn/no-negated-condition`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v45.0.0/docs/rules/no-negated-condition.md)
- [`@cloudfour/unicorn/no-typeof-undefined`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v45.0.0/docs/rules/no-typeof-undefined.md)
- [`@cloudfour/unicorn/no-unnecessary-await`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v45.0.0/docs/rules/no-unnecessary-await.md)
- [`@cloudfour/unicorn/prefer-set-size`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v45.0.0/docs/rules/prefer-set-size.md)
- [`@cloudfour/unicorn/switch-case-braces`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v45.0.0/docs/rules/switch-case-braces.md)
- [`@cloudfour/unicorn/prefer-blob-reading-methods`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v47.0.0/docs/rules/prefer-blob-reading-methods.md)
- [`@cloudfour/unicorn/prefer-event-target`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v47.0.0/docs/rules/prefer-event-target.md)

**Newly Disabled Rules**

- [`@cloudfour/unicorn/prefer-event-target`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v45.0.0/docs/rules/prefer-event-target.md)

- [#497](https://github.com/cloudfour/eslint-config/pull/497) [`2b0364a`](https://github.com/cloudfour/eslint-config/commit/2b0364ac87a657946afeb0e32989b3d1dcfdd178) Thanks [@renovate](https://github.com/apps/renovate)! - Update `eslint-plugin-jsdoc` from `v39` to `v46`

**Reconfigured Rules**

The `@cloudfour/jsdoc/tag-lines` rule is now configured to enforce one blank line in JSDoc comments between the description of a function and the `@param`/other tags.

For example, the blank line after the description is enforced here:

```js
/**
* This is the description for the function, the blank line below this is enforced
*
* @param {string} name A parameter called name
*/
function someFunction(name) {}
```

**New Rules**

- [`@cloudfour/jsdoc/informative-docs`](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/informative-docs.md#repos-sticky-header)
- [`@cloudfour/jsdoc/no-blank-block-descriptions`](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-blank-block-descriptions.md#repos-sticky-header)
- [`@cloudfour/jsdoc/no-blank-blocks`](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-blank-blocks.md#repos-sticky-header)

**Deleted Rules**

- [`@cloudfour/jsdoc/newline-after-description`](https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-newline-after-description)

**Newly Enabled Rules**

- [`@cloudfour/jsdoc/no-defaults`](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-defaults.md#repos-sticky-header)

- [#498](https://github.com/cloudfour/eslint-config/pull/498) [`ee07640`](https://github.com/cloudfour/eslint-config/commit/ee07640d95f9038d807299e067b321392c058b79) Thanks [@calebeby](https://github.com/calebeby)! - Drop support for Node 14 (now only node 16+ is supported)

## 21.1.0

### Minor Changes
Original file line number Diff line number Diff line change
@@ -588,34 +588,39 @@ export function buildFieldsInitNodes(
}

switch (true) {
case isStatic && isPrivate && isField && loose:
case isStatic && isPrivate && isField && loose: {
needsClassRef = true;
staticNodes.push(
buildPrivateFieldInitLoose(t.cloneNode(ref), prop, privateNamesMap)
);
break;
case isStatic && isPrivate && isField && !loose:
}
case isStatic && isPrivate && isField && !loose: {
needsClassRef = true;
staticNodes.push(
buildPrivateStaticFieldInitSpec(prop, privateNamesMap)
);
break;
case isStatic && isPublic && isField && loose:
}
case isStatic && isPublic && isField && loose: {
needsClassRef = true;
staticNodes.push(buildPublicFieldInitLoose(t.cloneNode(ref), prop));
break;
case isStatic && isPublic && isField && !loose:
}
case isStatic && isPublic && isField && !loose: {
needsClassRef = true;
staticNodes.push(
buildPublicFieldInitSpec(t.cloneNode(ref), prop, state)
);
break;
case isInstance && isPrivate && isField && loose:
}
case isInstance && isPrivate && isField && loose: {
instanceNodes.push(
buildPrivateFieldInitLoose(t.thisExpression(), prop, privateNamesMap)
);
break;
case isInstance && isPrivate && isField && !loose:
}
case isInstance && isPrivate && isField && !loose: {
instanceNodes.push(
buildPrivateInstanceFieldInitSpec(
t.thisExpression(),
@@ -624,15 +629,17 @@ export function buildFieldsInitNodes(
)
);
break;
case isInstance && isPrivate && isMethod && loose:
}
case isInstance && isPrivate && isMethod && loose: {
instanceNodes.unshift(
buildPrivateMethodInitLoose(t.thisExpression(), prop, privateNamesMap)
);
staticNodes.push(
buildPrivateMethodDeclaration(prop, privateNamesMap, loose)
);
break;
case isInstance && isPrivate && isMethod && !loose:
}
case isInstance && isPrivate && isMethod && !loose: {
instanceNodes.unshift(
buildPrivateInstanceMethodInitSpec(
t.thisExpression(),
@@ -644,7 +651,8 @@ export function buildFieldsInitNodes(
buildPrivateMethodDeclaration(prop, privateNamesMap, loose)
);
break;
case isStatic && isPrivate && isMethod && !loose:
}
case isStatic && isPrivate && isMethod && !loose: {
needsClassRef = true;
staticNodes.push(
buildPrivateStaticFieldInitSpec(prop, privateNamesMap)
@@ -653,7 +661,8 @@ export function buildFieldsInitNodes(
buildPrivateMethodDeclaration(prop, privateNamesMap, loose)
);
break;
case isStatic && isPrivate && isMethod && loose:
}
case isStatic && isPrivate && isMethod && loose: {
needsClassRef = true;
staticNodes.push(
buildPrivateStaticMethodInitLoose(
@@ -667,16 +676,20 @@ export function buildFieldsInitNodes(
buildPrivateMethodDeclaration(prop, privateNamesMap, loose)
);
break;
case isInstance && isPublic && isField && loose:
}
case isInstance && isPublic && isField && loose: {
instanceNodes.push(buildPublicFieldInitLoose(t.thisExpression(), prop));
break;
case isInstance && isPublic && isField && !loose:
}
case isInstance && isPublic && isField && !loose: {
instanceNodes.push(
buildPublicFieldInitSpec(t.thisExpression(), prop, state)
);
break;
default:
}
default: {
throw new Error('Unreachable.');
}
}
}

Original file line number Diff line number Diff line change
@@ -89,9 +89,10 @@ export default function convertFunctionParams(path, loose) {
break;
}

case 'FunctionDeclaration':
case 'FunctionDeclaration': {
shadowedParams.add(name);
break;
}
}
}
}
57 changes: 38 additions & 19 deletions fixtures/downshift/src/hooks/useCombobox/reducer.js
Original file line number Diff line number Diff line change
@@ -9,20 +9,22 @@ export default function downshiftUseComboboxReducer(state, action) {
let changes;

switch (type) {
case stateChangeTypes.ItemMouseMove:
case stateChangeTypes.ItemMouseMove: {
changes = {
highlightedIndex: action.index,
};
break;
case stateChangeTypes.ItemClick:
}
case stateChangeTypes.ItemClick: {
changes = {
isOpen: getDefaultValue(props, 'isOpen'),
highlightedIndex: getDefaultValue(props, 'highlightedIndex'),
selectedItem: props.items[action.index],
inputValue: props.itemToString(props.items[action.index]),
};
break;
case stateChangeTypes.InputKeyDownArrowDown:
}
case stateChangeTypes.InputKeyDownArrowDown: {
changes = state.isOpen
? {
highlightedIndex: getNextWrappingIndex(
@@ -44,7 +46,8 @@ export default function downshiftUseComboboxReducer(state, action) {
};

break;
case stateChangeTypes.InputKeyDownArrowUp:
}
case stateChangeTypes.InputKeyDownArrowUp: {
changes = state.isOpen
? {
highlightedIndex: getNextWrappingIndex(
@@ -66,7 +69,8 @@ export default function downshiftUseComboboxReducer(state, action) {
};

break;
case stateChangeTypes.InputKeyDownEnter:
}
case stateChangeTypes.InputKeyDownEnter: {
changes = {
...(state.highlightedIndex >= 0 && {
selectedItem: props.items[state.highlightedIndex],
@@ -76,15 +80,17 @@ export default function downshiftUseComboboxReducer(state, action) {
}),
};
break;
case stateChangeTypes.InputKeyDownEscape:
}
case stateChangeTypes.InputKeyDownEscape: {
changes = {
isOpen: false,
selectedItem: null,
highlightedIndex: -1,
inputValue: '',
};
break;
case stateChangeTypes.InputKeyDownHome:
}
case stateChangeTypes.InputKeyDownHome: {
changes = {
highlightedIndex: getNextNonDisabledIndex(
1,
@@ -95,7 +101,8 @@ export default function downshiftUseComboboxReducer(state, action) {
),
};
break;
case stateChangeTypes.InputKeyDownEnd:
}
case stateChangeTypes.InputKeyDownEnd: {
changes = {
highlightedIndex: getNextNonDisabledIndex(
-1,
@@ -106,7 +113,8 @@ export default function downshiftUseComboboxReducer(state, action) {
),
};
break;
case stateChangeTypes.InputBlur:
}
case stateChangeTypes.InputBlur: {
changes = {
isOpen: false,
...(state.highlightedIndex >= 0 && {
@@ -116,63 +124,74 @@ export default function downshiftUseComboboxReducer(state, action) {
}),
};
break;
case stateChangeTypes.InputChange:
}
case stateChangeTypes.InputChange: {
changes = {
isOpen: true,
highlightedIndex: getDefaultValue(props, 'highlightedIndex'),
inputValue: action.inputValue,
};
break;
case stateChangeTypes.MenuMouseLeave:
}
case stateChangeTypes.MenuMouseLeave: {
changes = {
highlightedIndex: -1,
};
break;
}
case stateChangeTypes.ToggleButtonClick:
case stateChangeTypes.FunctionToggleMenu:
case stateChangeTypes.FunctionToggleMenu: {
changes = {
isOpen: !state.isOpen,
highlightedIndex: state.isOpen
? -1
: getHighlightedIndexOnOpen(props, state, 0),
};
break;
case stateChangeTypes.FunctionOpenMenu:
}
case stateChangeTypes.FunctionOpenMenu: {
changes = {
isOpen: true,
highlightedIndex: getHighlightedIndexOnOpen(props, state, 0),
};
break;
case stateChangeTypes.FunctionCloseMenu:
}
case stateChangeTypes.FunctionCloseMenu: {
changes = {
isOpen: false,
};
break;
case stateChangeTypes.FunctionSetHighlightedIndex:
}
case stateChangeTypes.FunctionSetHighlightedIndex: {
changes = {
highlightedIndex: action.highlightedIndex,
};
break;
case stateChangeTypes.FunctionSelectItem:
}
case stateChangeTypes.FunctionSelectItem: {
changes = {
selectedItem: action.selectedItem,
};
break;
case stateChangeTypes.FunctionSetInputValue:
}
case stateChangeTypes.FunctionSetInputValue: {
changes = {
inputValue: action.inputValue,
};
break;
case stateChangeTypes.FunctionReset:
}
case stateChangeTypes.FunctionReset: {
changes = {
highlightedIndex: getDefaultValue(props, 'highlightedIndex'),
isOpen: getDefaultValue(props, 'isOpen'),
selectedItem: getDefaultValue(props, 'selectedItem'),
inputValue: getDefaultValue(props, 'inputValue'),
};
break;
default:
}
default: {
throw new Error('Reducer called without proper action type.');
}
}

return {
Loading