-
Notifications
You must be signed in to change notification settings - Fork 52
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
fix(deps): update dependency eslint to v9 #2690
Changes from all commits
6036608
7b551b6
31ebd91
0ea1495
bc49416
e3659a3
0db30e2
77f5697
b50e4e5
68bddd5
eeb82ca
cbd7ceb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
const nodePrettier = require("@cybozu/eslint-config/presets/node-prettier"); | ||
const prettier = require("@cybozu/eslint-config/presets/prettier"); | ||
const typescriptPrettier = require("@cybozu/eslint-config/presets/typescript-prettier"); | ||
const FlatCompat = require("@eslint/eslintrc").FlatCompat; | ||
const js = require("@eslint/js"); | ||
const { fixupConfigRules } = require("@eslint/compat"); | ||
const eslintPluginNode = require("eslint-plugin-node"); | ||
const globals = require("globals"); | ||
|
||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
}); | ||
|
||
module.exports = [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The flat config file format has been the default configuration file format since ESLint v9.0.0 The previous format, eslintrc, is now deprecated . |
||
...fixupConfigRules( | ||
compat.extends("@cybozu/eslint-config/presets/node-typescript-prettier"), | ||
eslintPluginNode, | ||
), | ||
{ | ||
files: ["**/*.ts"], | ||
rules: { | ||
curly: ["error", "all"], | ||
"func-style": ["error"], | ||
"@typescript-eslint/ban-types": [ | ||
"error", | ||
{ | ||
types: { | ||
object: false, | ||
"{}": false, | ||
}, | ||
}, | ||
], | ||
"@typescript-eslint/consistent-type-imports": [ | ||
"error", | ||
{ | ||
prefer: "type-imports", | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
files: ["plugin-uploader/**/*.ts"], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
rules: { | ||
/* ref | ||
* - https://github.com/eslint/eslint/issues/11899 | ||
* - https://github.com/eslint/eslint/issues/11954 | ||
*/ | ||
"require-atomic-updates": "off", | ||
}, | ||
}, | ||
{ | ||
nodePrettier, | ||
files: ["plugin-packer/bin/**/*.ts", "plugin-packer/bin/**/*.js"], | ||
}, | ||
{ | ||
prettier, | ||
files: ["plugin-packer/site/**/*.ts", "plugin-packer/site/**/*.js"], | ||
languageOptions: { | ||
globals: { | ||
...globals.jest, | ||
...globals.node, | ||
}, | ||
}, | ||
}, | ||
{ | ||
prettier, | ||
files: ["plugin-packer/test/**/*.ts", "plugin-packer/test/**/*.js"], | ||
languageOptions: { | ||
globals: { | ||
...globals.jest, | ||
}, | ||
}, | ||
}, | ||
{ | ||
typescriptPrettier, | ||
files: ["create-plugin/template/modern/**/*.ts"], | ||
languageOptions: { | ||
globals: { | ||
kintone: false, | ||
}, | ||
}, | ||
}, | ||
]; |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,16 +39,19 @@ | |
"@babel/preset-typescript": "^7.24.1", | ||
"@cybozu/eslint-config": "^23.0.0", | ||
"@cybozu/license-manager": "^1.2.1", | ||
"@eslint/compat": "^1.0.3", | ||
"@eslint/eslintrc": "^3.1.0", | ||
"@types/jest": "^29.5.12", | ||
"@types/node": "^18.19.34", | ||
"babel-jest": "^29.7.0", | ||
"comment-json": "^4.2.3", | ||
"eslint": "^8.57.0", | ||
"eslint": "^9.4.0", | ||
"jest": "^29.7.0", | ||
"npm-run-all": "^4.1.5", | ||
"prettier": "^3.2.5", | ||
"rimraf": "^5.0.7", | ||
"typescript": "^5.4.5" | ||
"typescript": "^5.4.5", | ||
"globals": "^15.4.0" | ||
}, | ||
"packageManager": "[email protected]", | ||
"pnpm": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,7 @@ | |
"start": "pnpm build --watch", | ||
"build": "pnpm clean && tsc --build --force", | ||
"clean": "rimraf dist", | ||
"lint": "eslint --ext .ts src --max-warnings 0", | ||
"lint": "eslint src --max-warnings 0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The following CLI flags are no longer supported with the flat config file format:
Ref: https://eslint.org/docs/latest/use/configure/migration-guide#cli-flag-changes |
||
"fix": "pnpm lint --fix", | ||
"test": "jest --testPathIgnorePatterns=/__tests__/generator\\.test\\.ts$", | ||
"test:generator": "cross-env NODE_ENV=e2e jest --testPathPattern=/__tests__/generator\\.test\\.ts$", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
module.exports = { | ||
extends: [ | ||
'@cybozu/eslint-config/globals/kintone.js', | ||
'@cybozu/eslint-config/lib/base.js', | ||
'@cybozu/eslint-config/lib/kintone.js', | ||
'@cybozu/eslint-config/lib/prettier.js', | ||
"@cybozu/eslint-config/globals/kintone.js", | ||
"@cybozu/eslint-config/lib/base.js", | ||
"@cybozu/eslint-config/lib/kintone.js", | ||
"@cybozu/eslint-config/lib/prettier.js", | ||
], | ||
rules: { | ||
'prettier/prettier': ['error', { singleQuote: true }], | ||
'space-before-function-paren': 0, | ||
'object-curly-spacing': 0, | ||
"prettier/prettier": ["error", { singleQuote: true }], | ||
"space-before-function-paren": 0, | ||
"object-curly-spacing": 0, | ||
}, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export const Constans = { | ||
export const Constant = { | ||
MAX_RETRY_COUNT: 3, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
export const log = (message: string) => { | ||
// eslint-disable-next-line no-console | ||
console.log(message); | ||
}; |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"use strict"; | ||
/* globals describe, expect, it, beforeEach, afterEach */ | ||
|
||
const { | ||
reducer, | ||
|
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -258,7 +258,6 @@ export class RecordClient extends BaseClient { | |
const conditionQuery = condition ? `(${condition}) and ` : ""; | ||
let allRecords: T[] = []; | ||
let lastId = "0"; | ||
// eslint-disable-next-line no-constant-condition | ||
while (true) { | ||
const query = `${conditionQuery}$id > ${lastId} order by $id asc limit ${GET_RECORDS_LIMIT}`; | ||
const result = await this.getRecords<T>({ ...rest, fields, query }); | ||
|
@@ -289,7 +288,6 @@ export class RecordClient extends BaseClient { | |
const conditionQuery = condition ? `${condition} ` : ""; | ||
let allRecords: T[] = []; | ||
let offset = 0; | ||
// eslint-disable-next-line no-constant-condition | ||
while (true) { | ||
const query = `${conditionQuery}${ | ||
orderBy ? `order by ${orderBy} ` : "" | ||
|
@@ -315,7 +313,6 @@ export class RecordClient extends BaseClient { | |
const { id } = await this.createCursor(params); | ||
try { | ||
let allRecords: T[] = []; | ||
// eslint-disable-next-line no-constant-condition | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using the recommended config from @eslint/js in a configuration file enables this rule. |
||
while (true) { | ||
const result = await this.getRecordsByCursor<T>({ id }); | ||
allRecords = allRecords.concat(result.records); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import FlatCompat and create a new instance to convert an existing eslintrc config. For example, if the npm package eslint-config-my-config is in eslintrc format.
Ref: https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
TypeError: Missing parameter 'recommendedConfig' in FlatCompat constructor
=> The recommendedConfig option is required when any config uses eslint:recommended, including any config in an extends clause. To fix this, using @eslint/js to provide the eslint:recommended config.
Ref: https://github.com/eslint/eslintrc?tab=readme-ov-file#troubleshooting