mirror of
https://github.com/theoludwig/eslint-config-conventions.git
synced 2025-05-18 12:02:33 +02:00
feat: support both JavaScript and TypeScript linting
This commit is contained in:
@ -1,8 +1,13 @@
|
||||
const { ESLint } = require('eslint')
|
||||
const test = require('tape')
|
||||
|
||||
const eslint = new ESLint({
|
||||
ignore: false,
|
||||
useEslintrc: false,
|
||||
overrideConfigFile: 'eslintrc.json'
|
||||
})
|
||||
|
||||
test('ensure we validate correctly JavaScript files', async (t) => {
|
||||
const eslint = new ESLint({ ignore: false })
|
||||
const [noErrors] = await eslint.lintFiles(
|
||||
'test/fixtures/javascript-no-errors.js'
|
||||
)
|
||||
@ -15,7 +20,6 @@ test('ensure we validate correctly JavaScript files', async (t) => {
|
||||
})
|
||||
|
||||
test('ensure we validate correctly TypeScript files', async (t) => {
|
||||
const eslint = new ESLint({ ignore: false })
|
||||
const [noErrors] = await eslint.lintFiles(
|
||||
'test/fixtures/typescript-no-errors.ts'
|
||||
)
|
||||
@ -28,7 +32,6 @@ test('ensure we validate correctly TypeScript files', async (t) => {
|
||||
})
|
||||
|
||||
test('ensure we allow top-level await', async (t) => {
|
||||
const eslint = new ESLint({ ignore: false })
|
||||
const [lintResult] = await eslint.lintFiles(
|
||||
'test/fixtures/top-level-await.mjs'
|
||||
)
|
||||
|
Reference in New Issue
Block a user