diff --git a/.eslintrc.yml b/.eslintrc.yml index 6b2d1eab..c78e1ab6 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -5,6 +5,7 @@ parserOptions: jsx: true ecmaVersion: 2020 sourceType: module + extraFileExtensions: ['.cjs'] project: ./tsconfig.json env: @@ -220,3 +221,10 @@ overrides: - '@typescript-eslint' parserOptions: project: ./bench/tsconfig.json + + - files: + - ./*.{cjs,js} + plugins: + - '@typescript-eslint' + parserOptions: + project: ./tsconfig.root-lint.json diff --git a/.github/workflows/napi3.yaml b/.github/workflows/napi3.yaml index 5548f8ce..b7e5924b 100644 --- a/.github/workflows/napi3.yaml +++ b/.github/workflows/napi3.yaml @@ -73,6 +73,11 @@ jobs: command: test args: -p napi-sys --lib -- --nocapture + - name: Write ava.config.js for ava@2 + run: | + node write-ava-config.js + cat ava.config.js + - name: Unit tests run: | yarn --cwd ./test_module --ignore-engines build diff --git a/tsconfig.root-lint.json b/tsconfig.root-lint.json new file mode 100644 index 00000000..a4f467cf --- /dev/null +++ b/tsconfig.root-lint.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfig.json", + "files": ["./ava.config.cjs", "./write-ava-config.js"] +} diff --git a/write-ava-config.js b/write-ava-config.js new file mode 100644 index 00000000..01842d84 --- /dev/null +++ b/write-ava-config.js @@ -0,0 +1,10 @@ +const { writeFileSync } = require('fs') +const { join } = require('path') + +const config = require('./ava.config.cjs') + +const code = ` +export default ${JSON.stringify(config, null, 2)} +` + +writeFileSync(join(__dirname, 'ava.config.js'), code)