File tree Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 4747 "devDependencies" : {
4848 "@typescript-eslint/eslint-plugin" : " ^7.0.2" ,
4949 "@typescript-eslint/parser" : " ^7.0.2" ,
50- "ava" : " ^2.4.0 " ,
50+ "ava" : " ^6.1.2 " ,
5151 "eslint" : " ^8.56.0" ,
5252 "typescript" : " ^5.3.3"
5353 },
Original file line number Diff line number Diff line change 1- import test from 'ava' ;
2- import { ESLint } from 'eslint' ;
3- import config from '../index.js' ;
1+ const test = require ( 'ava' ) ;
2+ const { ESLint} = require ( 'eslint' ) ;
3+
4+ const config = require ( '../index.js' ) ;
45
56const hasRule = ( errors , ruleId ) => errors . some ( error => error . ruleId === ruleId ) ;
67
@@ -10,12 +11,13 @@ async function runEslint(string, config) {
1011 overrideConfig : config ,
1112 } ) ;
1213
13- const [ firstResult ] = await eslint . lintText ( string , { filePath : '_x.ts' } ) ;
14+ const [ firstResult ] = await eslint . lintText ( string , { filePath : 'test/ _x.ts' } ) ;
1415
1516 return firstResult . messages ;
1617}
1718
18- test . failing ( 'main' , async t => {
19+ test ( 'main' , async t => {
1920 const errors = await runEslint ( 'const foo: number = 5;' , config ) ;
2021 t . true ( hasRule ( errors , '@typescript-eslint/no-inferrable-types' ) , JSON . stringify ( errors ) ) ;
22+ t . is ( errors . length , 1 ) ;
2123} ) ;
Original file line number Diff line number Diff line change 11{
2+ "compilerOptions" : {
3+ "strict" : true ,
4+ },
25 "include" : [
36 " test"
47 ]
You can’t perform that action at this time.
0 commit comments