Skip to content

Commit 15c7cee

Browse files
authored
fix(templates): next16 linting issues (#322)
* fix(template): next16 linting issues * regen
1 parent cb431e5 commit 15c7cee

File tree

32 files changed

+173
-157
lines changed

32 files changed

+173
-157
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { defineConfig, globalIgnores } from 'eslint/config';
2+
import nextVitals from 'eslint-config-next/core-web-vitals';
3+
import nextTs from 'eslint-config-next/typescript';
4+
5+
const eslintConfig = defineConfig([
6+
...nextVitals,
7+
...nextTs,
8+
// Disable no-explicit-any
9+
{
10+
rules: {
11+
'@typescript-eslint/no-explicit-any': 'off',
12+
'@typescript-eslint/no-unused-vars': 'off',
13+
'@typescript-eslint/no-unused-expressions': 'off',
14+
'@next/next/no-img-element': 'off',
15+
'react/no-unescaped-entities': 'off',
16+
},
17+
},
18+
// Override default ignores of eslint-config-next.
19+
globalIgnores([
20+
// Default ignores of eslint-config-next:
21+
'.next/**',
22+
'out/**',
23+
'build/**',
24+
'next-env.d.ts',
25+
]),
26+
]);
27+
28+
export default eslintConfig;

packages/create-typink/templates/inkv5-nextjs/package.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"dev": "next dev --turbopack",
77
"build": "next build",
88
"start": "next start",
9-
"lint": "next lint",
9+
"lint": "eslint",
1010
"typegen": "npx tsx ./scripts/typegen.ts"
1111
},
1212
"dependencies": {
@@ -35,11 +35,8 @@
3535
"@types/node": "^24.5.2",
3636
"@types/react": "^19.1.1",
3737
"@types/react-dom": "^19.1.1",
38-
"@typescript-eslint/eslint-plugin": "^8.44.0",
39-
"@typescript-eslint/parser": "^8.44.0",
40-
"eslint": "^9.35.0",
41-
"eslint-import-resolver-typescript": "^4.4.4",
42-
"eslint-plugin-import": "^2.32.0",
38+
"eslint": "^9.39.1",
39+
"eslint-config-next": "^16.0.7",
4340
"prettier": "^3.6.2",
4441
"prettier-plugin-organize-imports": "^4.2.0",
4542
"tailwindcss": "^4.1.13",

packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/constructor-query.d.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ import type {
1212
} from 'dedot/contracts';
1313
import type { InkPrimitivesLangError } from './types.js';
1414

15-
export interface ConstructorQuery<
16-
ChainApi extends GenericSubstrateApi,
17-
Type extends MetadataType,
18-
> extends GenericConstructorQuery<ChainApi, Type> {
15+
export interface ConstructorQuery<Type extends MetadataType> extends GenericConstructorQuery<Type> {
1916
/**
2017
* Creates a new greeter contract initialized with the given value.
2118
*
@@ -25,7 +22,6 @@ export interface ConstructorQuery<
2522
* @selector 0x9bae9d5e
2623
**/
2724
new: GenericConstructorQueryCall<
28-
ChainApi,
2925
(
3026
initValue: string,
3127
options?: ConstructorCallOptions,
@@ -41,7 +37,6 @@ export interface ConstructorQuery<
4137
* @selector 0xed4b9d1b
4238
**/
4339
default: GenericConstructorQueryCall<
44-
ChainApi,
4540
(options?: ConstructorCallOptions) => Promise<GenericConstructorCallResult<[], ContractInstantiateResult>>,
4641
Type
4742
>;

packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/constructor-tx.d.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ import type {
1111
} from 'dedot/contracts';
1212

1313
export interface ConstructorTx<
14-
ChainApi extends GenericSubstrateApi,
1514
ContractApi extends InkGenericContractApi,
1615
Type extends MetadataType,
17-
> extends GenericConstructorTx<ChainApi, Type> {
16+
> extends GenericConstructorTx<Type> {
1817
/**
1918
* Creates a new greeter contract initialized with the given value.
2019
*
@@ -24,11 +23,7 @@ export interface ConstructorTx<
2423
* @selector 0x9bae9d5e
2524
**/
2625
new: GenericConstructorTxCall<
27-
ChainApi,
28-
(
29-
initValue: string,
30-
options?: ConstructorTxOptions,
31-
) => GenericInstantiateSubmittableExtrinsic<ChainApi, ContractApi>,
26+
(initValue: string, options?: ConstructorTxOptions) => GenericInstantiateSubmittableExtrinsic<ContractApi>,
3227
Type
3328
>;
3429

@@ -40,8 +35,7 @@ export interface ConstructorTx<
4035
* @selector 0xed4b9d1b
4136
**/
4237
default: GenericConstructorTxCall<
43-
ChainApi,
44-
(options?: ConstructorTxOptions) => GenericInstantiateSubmittableExtrinsic<ChainApi, ContractApi>,
38+
(options?: ConstructorTxOptions) => GenericInstantiateSubmittableExtrinsic<ContractApi>,
4539
Type
4640
>;
4741
}

packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/events.d.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ import type { GenericSubstrateApi } from 'dedot/types';
44
import type { AccountId32 } from 'dedot/codecs';
55
import type { GenericContractEvents, GenericContractEvent, MetadataType } from 'dedot/contracts';
66

7-
export interface ContractEvents<
8-
ChainApi extends GenericSubstrateApi,
9-
Type extends MetadataType,
10-
> extends GenericContractEvents<ChainApi, Type> {
7+
export interface ContractEvents<Type extends MetadataType> extends GenericContractEvents<Type> {
118
/**
129
*
1310
* @signature_topic: 0x184de1e97d8dba311c74fa923646f3bb4c5b0b4f747447857dbe70305dcd777e

packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/index.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ export interface GreeterContractApi<
2323
ChainApi extends GenericSubstrateApi = SubstrateApi,
2424
> extends InkGenericContractApi<ChainApi> {
2525
metadataType: 'ink';
26-
query: ContractQuery<ChainApi, 'ink'>;
27-
tx: ContractTx<ChainApi, 'ink'>;
28-
constructorQuery: ConstructorQuery<ChainApi, 'ink'>;
29-
constructorTx: ConstructorTx<ChainApi, GreeterContractApi, 'ink'>;
30-
events: ContractEvents<ChainApi, 'ink'>;
26+
query: ContractQuery<'ink'>;
27+
tx: ContractTx<'ink'>;
28+
constructorQuery: ConstructorQuery<'ink'>;
29+
constructorTx: ConstructorTx<GreeterContractApi, 'ink'>;
30+
events: ContractEvents<'ink'>;
3131
storage: {
3232
root(): Promise<Greeter>;
3333
lazy(): WithLazyStorage<Greeter>;

packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/query.d.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ import type {
1212
} from 'dedot/contracts';
1313
import type { InkPrimitivesLangError } from './types.js';
1414

15-
export interface ContractQuery<
16-
ChainApi extends GenericSubstrateApi,
17-
Type extends MetadataType,
18-
> extends GenericContractQuery<ChainApi, Type> {
15+
export interface ContractQuery<Type extends MetadataType> extends GenericContractQuery<Type> {
1916
/**
2017
* Returns the current value of `message`.
2118
*
@@ -24,7 +21,6 @@ export interface ContractQuery<
2421
* @selector 0x052cda08
2522
**/
2623
greet: GenericContractQueryCall<
27-
ChainApi,
2824
(options?: ContractCallOptions) => Promise<GenericContractCallResult<string, ContractCallResult>>,
2925
Type
3026
>;
@@ -38,7 +34,6 @@ export interface ContractQuery<
3834
* @selector 0x1fe7426f
3935
**/
4036
setMessage: GenericContractQueryCall<
41-
ChainApi,
4237
(newValue: string, options?: ContractCallOptions) => Promise<GenericContractCallResult<[], ContractCallResult>>,
4338
Type
4439
>;

packages/create-typink/templates/inkv5-nextjs/src/contracts/types/greeter/tx.d.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ import type {
99
MetadataType,
1010
} from 'dedot/contracts';
1111

12-
export interface ContractTx<ChainApi extends GenericSubstrateApi, Type extends MetadataType> extends GenericContractTx<
13-
ChainApi,
14-
Type
15-
> {
12+
export interface ContractTx<Type extends MetadataType> extends GenericContractTx<Type> {
1613
/**
1714
* Sets `message` to the given value.
1815
*
@@ -22,8 +19,7 @@ export interface ContractTx<ChainApi extends GenericSubstrateApi, Type extends M
2219
* @selector 0x1fe7426f
2320
**/
2421
setMessage: GenericContractTxCall<
25-
ChainApi,
26-
(newValue: string, options?: ContractTxOptions) => ContractSubmittableExtrinsic<ChainApi>,
22+
(newValue: string, options?: ContractTxOptions) => ContractSubmittableExtrinsic,
2723
Type
2824
>;
2925
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { defineConfig, globalIgnores } from 'eslint/config';
2+
import nextVitals from 'eslint-config-next/core-web-vitals';
3+
import nextTs from 'eslint-config-next/typescript';
4+
5+
const eslintConfig = defineConfig([
6+
...nextVitals,
7+
...nextTs,
8+
// Disable no-explicit-any
9+
{
10+
rules: {
11+
'@typescript-eslint/no-explicit-any': 'off',
12+
'@typescript-eslint/no-unused-vars': 'off',
13+
'@typescript-eslint/no-unused-expressions': 'off',
14+
'@next/next/no-img-element': 'off',
15+
'react/no-unescaped-entities': 'off',
16+
},
17+
},
18+
// Override default ignores of eslint-config-next.
19+
globalIgnores([
20+
// Default ignores of eslint-config-next:
21+
'.next/**',
22+
'out/**',
23+
'build/**',
24+
'next-env.d.ts',
25+
]),
26+
]);
27+
28+
export default eslintConfig;

packages/create-typink/templates/inkv6-nextjs/package.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"dev": "next dev --turbopack",
77
"build": "next build",
88
"start": "next start",
9-
"lint": "next lint",
9+
"lint": "eslint",
1010
"typegen": "npx tsx ./scripts/typegen.ts"
1111
},
1212
"dependencies": {
@@ -35,11 +35,8 @@
3535
"@types/node": "^24.5.2",
3636
"@types/react": "^19.1.1",
3737
"@types/react-dom": "^19.1.1",
38-
"@typescript-eslint/eslint-plugin": "^8.44.0",
39-
"@typescript-eslint/parser": "^8.44.0",
40-
"eslint": "^9.35.0",
41-
"eslint-import-resolver-typescript": "^4.4.4",
42-
"eslint-plugin-import": "^2.32.0",
38+
"eslint": "^9.39.1",
39+
"eslint-config-next": "^16.0.7",
4340
"prettier": "^3.6.2",
4441
"prettier-plugin-organize-imports": "^4.2.0",
4542
"tailwindcss": "^4.1.13",

0 commit comments

Comments
 (0)