File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import type { ESLint } from 'eslint' ;
1+ import type { ESLint , Linter } from 'eslint' ;
22
33declare const plugin : ESLint . Plugin & {
44 configs : {
5- 'flat/recommended' : ESLint . ConfigData ;
5+ 'flat/recommended' : Linter . Config ;
66 'recommended' : ESLint . ConfigData ;
77 }
88} ;
Original file line number Diff line number Diff line change 2525 "preversion" : " npm run test" ,
2626 "postpublish" : " git push --follow-tags" ,
2727 "test:watch" : " npm t -- --watch" ,
28- "test" : " mocha --timeout 50000 tests/lib/rules/no-literal-string/ && pnpm --filter='./examples/*' run lint"
28+ "test" : " mocha --timeout 50000 tests/lib/rules/no-literal-string/ tests/lib/index.d.ts.test.js && pnpm --filter='./examples/*' run lint"
2929 },
3030 "dependencies" : {
3131 "lodash" : " ^4.17.21" ,
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ const assert = require ( 'assert' ) ;
4+ const ts = require ( 'typescript' ) ;
5+ const path = require ( 'path' ) ;
6+
7+ describe ( 'types: flat recommended config' , ( ) => {
8+ it ( 'types flat/recommended as Linter.Config' , ( ) => {
9+ const source = `
10+ import i18next = require('${ path . resolve ( __dirname , '../../lib' ) } ');
11+ import type { Linter } from 'eslint';
12+
13+ const flatConfig: Linter.Config = i18next.configs['flat/recommended'];
14+ ` ;
15+
16+ const result = ts . transpileModule ( source , {
17+ compilerOptions : {
18+ module : ts . ModuleKind . CommonJS ,
19+ target : ts . ScriptTarget . ES2022 ,
20+ strict : true ,
21+ moduleResolution : ts . ModuleResolutionKind . Node10 ,
22+ esModuleInterop : true ,
23+ } ,
24+ reportDiagnostics : true ,
25+ } ) ;
26+
27+ assert . deepStrictEqual ( result . diagnostics || [ ] , [ ] ) ;
28+ } ) ;
29+ } ) ;
You can’t perform that action at this time.
0 commit comments