mirror of
https://github.com/strapi/strapi.git
synced 2025-10-16 18:44:18 +00:00
chore: update eslint (#18240)
* chore: update eslint deps & fix lint issues * chore: update prettier * fix: packagejson * Revert "chore: update prettier" This reverts commit 65f82dfa5b3b0a925fb0d86c20a7e555015c7b48.
This commit is contained in:
parent
2b6cb7373c
commit
d8c13912ba
16
package.json
16
package.json
@ -81,8 +81,8 @@
|
||||
"@swc/core": "1.3.58",
|
||||
"@swc/helpers": "0.5.1",
|
||||
"@swc/jest": "0.2.26",
|
||||
"@typescript-eslint/eslint-plugin": "5.62.0",
|
||||
"@typescript-eslint/parser": "5.62.0",
|
||||
"@typescript-eslint/eslint-plugin": "6.7.3",
|
||||
"@typescript-eslint/parser": "6.7.3",
|
||||
"babel-eslint": "10.1.0",
|
||||
"chalk": "4.1.2",
|
||||
"chokidar": "3.5.3",
|
||||
@ -93,17 +93,17 @@
|
||||
"eslint-config-airbnb": "^19.0.4",
|
||||
"eslint-config-airbnb-base": "^15.0.0",
|
||||
"eslint-config-airbnb-typescript": "^17.1.0",
|
||||
"eslint-config-prettier": "^8.10.0",
|
||||
"eslint-import-resolver-typescript": "3.6.0",
|
||||
"eslint-plugin-check-file": "2.6.1",
|
||||
"eslint-plugin-import": "^2.28.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-import-resolver-typescript": "3.6.1",
|
||||
"eslint-plugin-check-file": "2.6.2",
|
||||
"eslint-plugin-import": "^2.28.1",
|
||||
"eslint-plugin-jest-dom": "5.1.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.7.1",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"eslint-plugin-react": "^7.33.0",
|
||||
"eslint-plugin-react": "^7.33.2",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"eslint-plugin-testing-library": "5.11.0",
|
||||
"eslint-plugin-testing-library": "6.0.2",
|
||||
"execa": "5.1.1",
|
||||
"find-up": "5.0.0",
|
||||
"fs-extra": "10.0.0",
|
||||
|
@ -78,7 +78,7 @@
|
||||
"cross-env": "^7.0.3",
|
||||
"esbuild-loader": "^2.21.0",
|
||||
"eslint-config-custom": "4.14.0",
|
||||
"eslint-plugin-storybook": "0.6.13",
|
||||
"eslint-plugin-storybook": "0.6.14",
|
||||
"fork-ts-checker-webpack-plugin": "7.3.0",
|
||||
"msw": "1.3.0",
|
||||
"react": "^18.2.0",
|
||||
|
@ -67,7 +67,7 @@ const Table = ({
|
||||
withMainAction = false,
|
||||
renderBulkActionsBar,
|
||||
...rest
|
||||
}: TableProps<any>) => {
|
||||
}: TableProps<{ id: string }>) => {
|
||||
const [selectedEntries, setSelectedEntries] = useState<Array<number | string>>([]);
|
||||
const [showConfirmDeleteAll, setShowConfirmDeleteAll] = useState(false);
|
||||
const [showConfirmDelete, setShowConfirmDelete] = useState(false);
|
||||
@ -210,7 +210,7 @@ const Table = ({
|
||||
/>
|
||||
) : (
|
||||
Children.toArray(children).map((child) =>
|
||||
cloneElement(child as React.ReactElement<any>, {
|
||||
cloneElement(child as React.ReactElement, {
|
||||
entriesToDelete: selectedEntries,
|
||||
onClickDelete: handleClickDelete,
|
||||
onSelectRow: handleSelectRow,
|
||||
|
@ -334,7 +334,7 @@ describe('Permissions Engine', () => {
|
||||
{
|
||||
name: 'format.permission',
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
fn(permission) {
|
||||
fn() {
|
||||
return newPermissions[0];
|
||||
},
|
||||
},
|
||||
|
@ -13,6 +13,7 @@ import filePathToPath from './filepath-to-prop-path';
|
||||
export default async function loadFiles<T extends object>(
|
||||
dir: string,
|
||||
pattern: string,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
{ requireFn = importDefault, shouldUseFileNameAsKey = (_: any) => true, globArgs = {} } = {}
|
||||
): Promise<T> {
|
||||
const root = {};
|
||||
|
@ -5,10 +5,6 @@ import createPermissionEngine from './engine';
|
||||
|
||||
const typeSymbol = Symbol.for('__type__');
|
||||
|
||||
interface Action {
|
||||
[typeSymbol]: string[];
|
||||
}
|
||||
|
||||
interface ValidatePermissionHandler {
|
||||
(params: { permission: { action: string } }): boolean;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import _ from 'lodash';
|
||||
import { has, omit, pipe, assign } from 'lodash/fp';
|
||||
import type { Attribute, Common, Shared, Schema, Utils, EntityService } from '@strapi/types';
|
||||
import type { Attribute, Common, Schema, Utils, EntityService } from '@strapi/types';
|
||||
import { contentTypes as contentTypesUtils, mapAsync, errors } from '@strapi/utils';
|
||||
|
||||
type LoadedComponents<TUID extends Common.UID.Schema> = Attribute.GetValues<
|
||||
|
@ -138,4 +138,5 @@ const blockNodeValidator: any = yup.lazy((value: { type: string }) => {
|
||||
|
||||
const blocksValidator = yup.array().of(blockNodeValidator);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
export default (metas: any, options: any) => blocksValidator;
|
||||
|
@ -1,5 +1,4 @@
|
||||
import Router from '@koa/router';
|
||||
import _ from 'lodash';
|
||||
import { has } from 'lodash/fp';
|
||||
import { yup } from '@strapi/utils';
|
||||
import type { Strapi, Common } from '@strapi/types';
|
||||
|
@ -49,8 +49,6 @@ const uploadFile: UploadFile = async (uid, entity, files) => {
|
||||
modelUID = attr.component;
|
||||
tmpModel = strapi.components[attr.component];
|
||||
} else if (attr.type === 'dynamiczone') {
|
||||
const x = modelUID;
|
||||
|
||||
const entryIdx = path[i + 1]; // get component index
|
||||
const value = _.get(entity, [...currentPath, entryIdx]);
|
||||
|
||||
|
@ -91,6 +91,7 @@ export type GetValue<TAttribute extends Attribute.Attribute> = Utils.Expression.
|
||||
// Relation
|
||||
[
|
||||
Utils.Expression.Extends<TAttribute, Attribute.OfType<'relation'>>,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
TAttribute extends Attribute.Relation<infer _TOrigin, infer TRelationKind, infer TTarget>
|
||||
? Utils.Expression.If<
|
||||
Utils.Expression.IsNotNever<TTarget>,
|
||||
|
@ -36,4 +36,4 @@ export type GetComponentValue<TAttribute extends Attribute.Attribute> =
|
||||
: never;
|
||||
|
||||
export type GetComponentTarget<TAttribute extends Attribute.Attribute> =
|
||||
TAttribute extends Component<infer TComponentUID, infer _TRepeatable> ? TComponentUID : never;
|
||||
TAttribute extends Component<infer TComponentUID> ? TComponentUID : never;
|
||||
|
@ -31,15 +31,13 @@ export type MediaValue<TMultiple extends Utils.Expression.BooleanValue = Utils.E
|
||||
|
||||
export type GetMediaValue<TAttribute extends Attribute.Attribute> = TAttribute extends Media<
|
||||
// Unused as long as the media value is any
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
infer _TKind,
|
||||
infer TMultiple
|
||||
>
|
||||
? MediaValue<TMultiple>
|
||||
: never;
|
||||
|
||||
export type GetMediaTarget<TAttribute extends Attribute.Attribute> = TAttribute extends Media<
|
||||
infer _TKind,
|
||||
infer _TMultiple
|
||||
>
|
||||
export type GetMediaTarget<TAttribute extends Attribute.Attribute> = TAttribute extends Media
|
||||
? MediaTarget
|
||||
: never;
|
||||
|
@ -7,6 +7,7 @@ export type Relation<
|
||||
// on TTarget -> TOrigin relations. Due to errors because of Attribute.Any [relation] very generic
|
||||
// representation, type mismatches were encountered and mappedBy/inversedBy are now regular strings.
|
||||
// It is kept to allow for future iterations without breaking the current type API
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
_TOrigin extends Common.UID.Schema = Common.UID.Schema,
|
||||
TRelationKind extends RelationKind.Any = RelationKind.Any,
|
||||
TTarget extends Common.UID.Schema = Common.UID.Schema
|
||||
@ -101,6 +102,7 @@ export type RelationValue<
|
||||
> = RelationPluralityModifier<TRelationKind, Attribute.GetValues<TTarget>>;
|
||||
|
||||
export type GetRelationValue<TAttribute extends Attribute.Attribute> = TAttribute extends Relation<
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
infer _TOrigin,
|
||||
infer TRelationKind,
|
||||
infer TTarget
|
||||
@ -109,7 +111,9 @@ export type GetRelationValue<TAttribute extends Attribute.Attribute> = TAttribut
|
||||
: never;
|
||||
|
||||
export type GetRelationTarget<TAttribute extends Attribute.Attribute> = TAttribute extends Relation<
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
infer _TOrigin,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
infer _TRelationKind,
|
||||
infer TTarget
|
||||
>
|
||||
|
@ -20,6 +20,7 @@ export type UID<
|
||||
// TODO: V5:
|
||||
// The TOrigin was used to narrow down the list of possible target attribute for a
|
||||
// UID, but was removed due to circular dependency issues and will be removed in V5
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
_TOrigin extends Common.UID.Schema = never,
|
||||
TTargetAttribute extends string = string,
|
||||
TOptions extends UIDOptions = UIDOptions
|
||||
@ -37,9 +38,6 @@ export type UID<
|
||||
|
||||
export type UIDValue = string;
|
||||
|
||||
export type GetUIDValue<TAttribute extends Attribute.Attribute> = TAttribute extends UID<
|
||||
infer _TOrigin,
|
||||
infer _TTargetAttribute
|
||||
>
|
||||
export type GetUIDValue<TAttribute extends Attribute.Attribute> = TAttribute extends UID
|
||||
? UIDValue
|
||||
: never;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { curry, isEmpty, isNil, isObject } from 'lodash/fp';
|
||||
import { curry, isEmpty, isNil } from 'lodash/fp';
|
||||
|
||||
import { pipeAsync } from '../async';
|
||||
import traverseEntity from '../traverse-entity';
|
||||
|
@ -116,6 +116,7 @@ declare module 'yup' {
|
||||
isKebabCase(message?: string): this;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
interface ObjectSchema<TShape> {
|
||||
onlyContainsFunctions(message?: string): this;
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ module.exports = {
|
||||
'@typescript-eslint/no-shadow': 'off',
|
||||
'@typescript-eslint/naming-convention': 'warn',
|
||||
'@typescript-eslint/no-empty-interface': 'warn',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
|
@ -13,6 +13,7 @@ module.exports = {
|
||||
process: true,
|
||||
},
|
||||
rules: {
|
||||
'@typescript-eslint/no-explicit-any': 'warn',
|
||||
/**
|
||||
* This is useful to have for JS files, it's overwritten
|
||||
* by `plugin:@typescript-eslint/recommended` for TS files.
|
||||
|
Loading…
x
Reference in New Issue
Block a user