Skip to content

Commit

Permalink
fix(deps)!: update eslint group to v9 (major) (#1251)
Browse files Browse the repository at this point in the history
* fix(deps): update eslint group to v9

* chore: remove @types/eslint

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: teppeis <[email protected]>
  • Loading branch information
renovate[bot] and teppeis authored Sep 8, 2024
1 parent 72df7c3 commit 600bc7e
Show file tree
Hide file tree
Showing 11 changed files with 146 additions and 210 deletions.
325 changes: 131 additions & 194 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@
},
"dependencies": {
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
"@eslint/js": "^8.57.0",
"@types/eslint": "^8.56.12",
"@eslint/js": "^9.10.0",
"deepmerge": "^4.3.1",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import-x": "^4.2.1",
Expand All @@ -61,7 +60,7 @@
"@types/eslint__js": "^8.42.3",
"@types/node": "^18.19.50",
"@types/react": "^18.3.5",
"eslint": "^8.57.0",
"eslint": "^9.10.0",
"eslint-config-prettier": "^9.1.0",
"glob": "^10.4.5",
"mocha": "^10.7.3",
Expand All @@ -70,7 +69,7 @@
"typescript": "^5.5.4"
},
"peerDependencies": {
"eslint": "^8.57.0",
"eslint": "^9.10.0",
"prettier": "^3.3.3"
},
"peerDependenciesMeta": {
Expand Down
4 changes: 2 additions & 2 deletions src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ interface BuildOptions {

export async function build(
options: BuildOptions,
...additionalConfigs: Linter.FlatConfig[]
): Promise<Linter.FlatConfig[]> {
...additionalConfigs: Linter.Config[]
): Promise<Linter.Config[]> {
const { base, typescript, project, esm } = options;

const baseConfigNames = ["es2021", "es2022", "es2023", "node18", "node20"];
Expand Down
2 changes: 1 addition & 1 deletion src/configs/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Linter } from "eslint";
import unicorn from "eslint-plugin-unicorn";
import globals from "globals";

export const browser: Linter.FlatConfig = {
export const browser: Linter.Config = {
files: ["**/*.{js,cjs,mjs,jsx,ts,tsx,cts,mts}"],
languageOptions: {
globals: {
Expand Down
2 changes: 1 addition & 1 deletion src/configs/mocha.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Linter } from "eslint";
import globals from "globals";

export const mocha: Linter.FlatConfig = {
export const mocha: Linter.Config = {
files: ["**/test/**/*.{js,cjs,mjs,jsx,ts,tsx,cts,mts}"],
languageOptions: {
globals: {
Expand Down
2 changes: 1 addition & 1 deletion src/configs/module-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import type { Linter } from "eslint";
import importX from "eslint-plugin-import-x";

export const moduleBase: Linter.FlatConfig = {
export const moduleBase: Linter.Config = {
languageOptions: {
sourceType: "module",
},
Expand Down
2 changes: 1 addition & 1 deletion src/configs/node-esm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import type { Linter } from "eslint";
import unicorn from "eslint-plugin-unicorn";

export const nodeEsm: Linter.FlatConfig = {
export const nodeEsm: Linter.Config = {
languageOptions: {
sourceType: "module",
},
Expand Down
2 changes: 1 addition & 1 deletion src/configs/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import n from "eslint-plugin-n";
import unicorn from "eslint-plugin-unicorn";
import globals from "globals";

export const node: Linter.FlatConfig = {
export const node: Linter.Config = {
languageOptions: {
sourceType: "commonjs",
globals: {
Expand Down
2 changes: 1 addition & 1 deletion src/configs/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { moduleBase } from "./module-base.js";

export const typescript = merge(
moduleBase,
...(tsEslint.configs.recommended as Linter.FlatConfig[]),
...(tsEslint.configs.recommended as Linter.Config[]),
{
files: ["**/*.{ts,tsx,mts,cts}"],
languageOptions: {
Expand Down
2 changes: 1 addition & 1 deletion src/merge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { ArrayMergeOptions } from "deepmerge";
import deepmerge from "deepmerge";
import type { Linter } from "eslint";

type FlatConfig = Linter.FlatConfig;
type FlatConfig = Linter.Config;

export function merge(first: FlatConfig, ...rest: FlatConfig[]): FlatConfig {
if (rest.length === 0) {
Expand Down
6 changes: 3 additions & 3 deletions test/configs.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function isEnabledRule(ruleLevel) {
}

/**
* @param {import("eslint").Linter.FlatConfig} config
* @param {import("eslint").Linter.Config} config
* @param {string} configName
*/
function testConfig(config, configName) {
Expand All @@ -104,7 +104,7 @@ function testConfig(config, configName) {

/**
* @param {string} filePath
* @param {import("eslint").Linter.FlatConfig} config
* @param {import("eslint").Linter.Config} config
*/
async function testFile(filePath, config) {
const match = /([^.]*)\.(pass|fail)\.(?:js|ts)$/.exec(filePath);
Expand Down Expand Up @@ -148,7 +148,7 @@ async function testFile(filePath, config) {

/**
* @param {string} file
* @param {import("eslint").Linter.FlatConfig} config
* @param {import("eslint").Linter.Config} config
*/
async function verify(file, config) {
const linter = new Linter({ configType: "flat" });
Expand Down

0 comments on commit 600bc7e

Please sign in to comment.