Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update eslint and prettier (minor) #778

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jun 1, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
eslint (source) ^9.11.1 -> ^9.16.0 age adoption passing confidence
eslint-plugin-import-x ^4.4.3 -> ^4.5.0 age adoption passing confidence
eslint-plugin-n ^17.10.3 -> ^17.14.0 age adoption passing confidence
eslint-plugin-react ^7.36.1 -> ^7.37.2 age adoption passing confidence
prettier (source) ^3.3.3 -> ^3.4.1 age adoption passing confidence

Release Notes

eslint/eslint (eslint)

v9.16.0

Compare Source

Features

  • 8f70eb1 feat: Add ignoreComputedKeys option in sort-keys rule (#​19162) (Milos Djermanovic)

Documentation

  • 9eefc8f docs: fix typos in use-isnan (#​19190) (루밀LuMir)
  • 0c8cea8 docs: switch the order of words in no-unreachable (#​19189) (루밀LuMir)
  • 0c19417 docs: add missing backtick to no-async-promise-executor (#​19188) (루밀LuMir)
  • 8df9276 docs: add backtick in -0 in description of no-compare-neg-zero (#​19186) (루밀LuMir)
  • 7e16e3f docs: fix caseSensitive option's title of sort-keys (#​19183) (Tanuj Kanti)
  • 0c6b842 docs: fix typos in migration-guide.md (#​19180) (루밀LuMir)
  • 353266e docs: fix a typo in debug.md (#​19179) (루밀LuMir)
  • 5ff318a docs: delete unnecessary horizontal rule(---) in nodejs-api (#​19175) (루밀LuMir)
  • 576bcc5 docs: mark more rules as handled by TypeScript (#​19164) (Tanuj Kanti)
  • 742d054 docs: note that no-restricted-syntax can be used with any language (#​19148) (Milos Djermanovic)

Chores

v9.15.0

Compare Source

v9.14.0

Compare Source

v9.13.0

Compare Source

v9.12.0

Compare Source

Features

Bug Fixes

Documentation

  • ecbd522 docs: Mention code explorer (#​18978) (Nicholas C. Zakas)
  • 7ea4ecc docs: Clarifying the Use of Meta Objects (#​18697) (Amaresh S M)
  • d3e4b2e docs: Clarify how to exclude .js files (#​18976) (Milos Djermanovic)
  • 57232ff docs: Mention plugin-kit in language docs (#​18973) (Nicholas C. Zakas)
  • b80ed00 docs: Update README (GitHub Actions Bot)
  • cb69ab3 docs: Update README (GitHub Actions Bot)
  • 7fb0d95 docs: Update README (GitHub Actions Bot)
  • 493348a docs: Update README (GitHub Actions Bot)
  • 87a582c docs: fix typo in id-match rule (#​18944) (Jay)

Chores

un-ts/eslint-plugin-import-x (eslint-plugin-import-x)

v4.5.0

Compare Source

Minor Changes
For eslint-plugin-import-x users

Like the ESLint flat config allows you to use js objects (e.g. import and require) as ESLint plugins, the new eslint-plugin-import-x resolver settings allow you to use js objects as custom resolvers through the new setting import-x/resolver-next:

// eslint.config.js
import { createTsResolver } from '#custom-resolver';
const { createOxcResolver } = require('path/to/a/custom/resolver');

const resolverInstance = new ResolverFactory({});
const customResolverObject = {
  interfaceVersion: 3,
  name: 'my-custom-eslint-import-resolver',
  resolve(modPath, sourcePath) {
    const path = resolverInstance.resolve(modPath, sourcePath);
    if (path) {
      return {
        found: true,
        path
      };
    }

    return {
      found: false,
      path: null
    }
  };
};

module.exports = {
  settings: {
    // multiple resolvers
    'import-x/resolver-next': [
      customResolverObject,
      createTsResolver(enhancedResolverOptions),
      createOxcResolver(oxcOptions),
    ],
    // single resolver:
    'import-x/resolver-next': [createOxcResolver(oxcOptions)]
  }
}

The new import-x/resolver-next no longer accepts strings as the resolver, thus will not be compatible with the ESLint legacy config (a.k.a. .eslintrc). Those who are still using the ESLint legacy config should stick with import-x/resolver.

In the next major version of eslint-plugin-import-x (v5), we will rename the currently existing import-x/resolver to import-x/resolver-legacy (which allows the existing ESLint legacy config users to use their existing resolver settings), and import-x/resolver-next will become the new import-x/resolver. When ESLint v9 (the last ESLint version with ESLint legacy config support) reaches EOL in the future, we will remove import-x/resolver-legacy.

We have also made a few breaking changes to the new resolver API design, so you can't use existing custom resolvers directly with import-x/resolver-next:

// When migrating to `import-x/resolver-next`, you CAN'T use legacy versions of resolvers directly:
module.exports = {
  settings: {
    // THIS WON'T WORK, the resolver interface required for `import-x/resolver-next` is different.
    'import-x/resolver-next': [
       require('eslint-import-resolver-node'),
       require('eslint-import-resolver-webpack'),
       require('some-custom-resolver')
    ];
  }
}

For easier migration, the PR also introduces a compat utility importXResolverCompat that you can use in your eslint.config.js:

// eslint.config.js
import eslintPluginImportX, { importXResolverCompat } from 'eslint-plugin-import-x';
// or
const eslintPluginImportX = require('eslint-plugin-import-x');
const { importXResolverCompat } = eslintPluginImportX;

module.exports = {
  settings: {
    // THIS WILL WORK as you have wrapped the previous version of resolvers with the `importXResolverCompat`
    'import-x/resolver-next': [
       importXResolverCompat(require('eslint-import-resolver-node'), nodeResolveOptions),
       importXResolverCompat(require('eslint-import-resolver-webpack'), webpackResolveOptions),
       importXResolverCompat(require('some-custom-resolver'), { option1: true, option2: '' })
    ];
  }
}
For custom import resolver developers

This is the new API design of the resolver interface:

export interface NewResolver {
  interfaceVersion: 3;
  name?: string; // This will be included in the debug log
  resolve: (modulePath: string, sourceFile: string) => ResolvedResult;
}

// The `ResultNotFound` (returned when not resolved) is the same, no changes
export interface ResultNotFound {
  found: false;
  path?: undefined;
}

// The `ResultFound` (returned resolve result) is also the same, no changes
export interface ResultFound {
  found: true;
  path: string | null;
}

export type ResolvedResult = ResultNotFound | ResultFound;

You will be able to import NewResolver from eslint-plugin-import-x/types.

The most notable change is that eslint-plugin-import-x no longer passes the third argument (options) to the resolve function.

We encourage custom resolvers' authors to consume the options outside the actual resolve function implementation. You can export a factory function to accept the options, this factory function will then be called inside the eslint.config.js to get the actual resolver:

// custom-resolver.js
exports.createCustomResolver = (options) => {
  // The options are consumed outside the `resolve` function.
  const resolverInstance = new ResolverFactory(options);

  return {
    name: 'custom-resolver',
    interfaceVersion: 3,
    resolve(mod, source) {
      const found = resolverInstance.resolve(mod, {});

      // Of course, you still have access to the `options` variable here inside
      // the `resolve` function. That's the power of JavaScript Closures~
    }
  }
};

// eslint.config.js
const { createCustomResolver } = require('custom-resolver')

module.exports = {
  settings: {
    'import-x/resolver-next': [
       createCustomResolver(options)
    ];
  }
}

This allows you to create a reusable resolver instance to improve the performance. With the existing version of the resolver interface, because the options are passed to the resolver function, you will have to create a resolver instance every time the resolve function is called:

module.exports = {
  interfaceVersion: 2,
  resolve(mod, source) {
    // every time the `resolve` function is called, a new instance is created
    // This is very slow
    const resolverInstance = ResolverFactory.createResolver({});
    const found = resolverInstance.resolve(mod, {});
  },
};

With the factory function pattern, you can create a resolver instance beforehand:

exports.createCustomResolver = (options) => {
  // `enhance-resolve` allows you to create a reusable instance:
  const resolverInstance = ResolverFactory.createResolver({});
  const resolverInstance = enhanceResolve.create({});

  // `oxc-resolver` also allows you to create a reusable instance:
  const resolverInstance = new ResolverFactory({});

  return {
    name: "custom-resolver",
    interfaceVersion: 3,
    resolve(mod, source) {
      // the same re-usable instance is shared across `resolve` invocations.
      // more performant
      const found = resolverInstance.resolve(mod, {});
    },
  };
};
Patch Changes
eslint-community/eslint-plugin-n (eslint-plugin-n)

v17.14.0

Compare Source

🌟 Features

v17.13.2

Compare Source

🩹 Fixes
  • no-missing-require: handle multiple resolvePaths (#​383) (df6ad2a)

v17.13.1

Compare Source

🩹 Fixes

v17.13.0

Compare Source

🌟 Features
🩹 Fixes
🧹 Chores

v17.12.0

Compare Source

🌟 Features
🩹 Fixes
🧹 Chores

v17.11.1

Compare Source

🩹 Fixes

v17.11.0

Compare Source

🌟 Features
🩹 Fixes
  • no-missing-import: Ignore node builtins in package.json imports (#​346) (148e47e)
  • no-missing-import: Resolve tsconfig paths relative to the tsconfig (#​343) (6cd7954)
📚 Documentation
  • Explain the transitive dependency case for no-extraneous-* (#​347) (8c0a2cc)
jsx-eslint/eslint-plugin-react (eslint-plugin-react)

v7.37.2

Compare Source

Fixed
  • [destructuring-assignment]: fix false negative when using typeof props.a (#​3835 @​golopot)
Changed
  • [Refactor] [destructuring-assignment]: use getParentStatelessComponent (#​3835 @​golopot)

v7.37.1

Compare Source

Fixed
Changed

v7.37.0

Compare Source

Added
Changed
prettier/prettier (prettier)

v3.4.1

Compare Source

diff

Remove unnecessary parentheses around assignment in v-on (#​16887 by @​fisker)
<!-- Input -->
<template>
  <button @&#8203;click="foo += 2">Click</button>
</template>

<!-- Prettier 3.4.0 -->
<template>
  <button @&#8203;click="(foo += 2)">Click</button>
</template>

<!-- Prettier 3.4.1 -->
<template>
  <button @&#8203;click="foo += 2">Click</button>
</template>

v3.4.0

Compare Source

diff

🔗 Release Notes


Configuration

📅 Schedule: Branch creation - "after 9pm,before 9am" in timezone Asia/Tokyo, Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot added the renovate label Jun 1, 2024
@renovate renovate bot changed the title chore(deps): update dependency prettier to ^3.3.0 fix(deps): update eslint and prettier (minor) Jun 5, 2024
@renovate renovate bot force-pushed the renovate/eslint-and-prettier branch 3 times, most recently from 0c4c05f to 029b47b Compare June 11, 2024 12:42
@renovate renovate bot force-pushed the renovate/eslint-and-prettier branch 8 times, most recently from cd2f97a to 5560df4 Compare June 20, 2024 14:34
@renovate renovate bot force-pushed the renovate/eslint-and-prettier branch 3 times, most recently from 7047dfa to 4a23144 Compare June 26, 2024 22:22
@renovate renovate bot force-pushed the renovate/eslint-and-prettier branch 4 times, most recently from 72e0e23 to cfa26a4 Compare July 17, 2024 12:37
@renovate renovate bot force-pushed the renovate/eslint-and-prettier branch 4 times, most recently from 86ecfbb to 550a92b Compare July 26, 2024 13:48
@renovate renovate bot force-pushed the renovate/eslint-and-prettier branch 2 times, most recently from ad2d289 to 8b5db80 Compare August 9, 2024 16:51
@renovate renovate bot force-pushed the renovate/eslint-and-prettier branch from 8b5db80 to 6a9a8ee Compare August 21, 2024 13:41
@renovate renovate bot force-pushed the renovate/eslint-and-prettier branch 2 times, most recently from de6abd6 to d838532 Compare September 27, 2024 22:02
@renovate renovate bot changed the title fix(deps): update dependency eslint-plugin-react to ^7.37.0 fix(deps): update dependency eslint-plugin-react to ^7.37.1 Oct 1, 2024
@renovate renovate bot force-pushed the renovate/eslint-and-prettier branch 2 times, most recently from 0709f51 to 44dfaa4 Compare October 2, 2024 22:42
@renovate renovate bot changed the title fix(deps): update dependency eslint-plugin-react to ^7.37.1 chore(deps): update eslint and prettier (minor) Oct 4, 2024
@renovate renovate bot force-pushed the renovate/eslint-and-prettier branch 3 times, most recently from 8ec615e to 7a2911a Compare October 9, 2024 15:04
@renovate renovate bot force-pushed the renovate/eslint-and-prettier branch 4 times, most recently from 907bd3c to 3494777 Compare October 23, 2024 20:05
@renovate renovate bot force-pushed the renovate/eslint-and-prettier branch 4 times, most recently from 353dd36 to 4ffd2d2 Compare November 1, 2024 22:36
@renovate renovate bot force-pushed the renovate/eslint-and-prettier branch 2 times, most recently from 8c84e06 to b980fe3 Compare November 7, 2024 15:03
@renovate renovate bot force-pushed the renovate/eslint-and-prettier branch 3 times, most recently from 65efbbd to f649f95 Compare November 21, 2024 20:27
@renovate renovate bot force-pushed the renovate/eslint-and-prettier branch 3 times, most recently from d06ece7 to a605a24 Compare December 3, 2024 06:12
@renovate renovate bot force-pushed the renovate/eslint-and-prettier branch from a605a24 to f6ebb1f Compare December 3, 2024 09:18
@sajikix sajikix merged commit f9af489 into master Dec 3, 2024
8 checks passed
@sajikix sajikix deleted the renovate/eslint-and-prettier branch December 3, 2024 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant