-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Extract glob helpers that are needed in a CJS environment * Ensure ava/plugin works in a CJS environment Refactor and deploy some tricks so that ava/plugin is usable in a CJS environment, even if the rest of AVA's internals become ESM. * Ensure 'ava' can be imported in a CJS environment * Convert to ESM * Load yargs as CJS due to strange compatibility issues * Keep line number parsing code as CJS because it attempts to lazy-load dependencies * Shared workers are always loaded through a dynamic import * Shared worker filenames must now be file:// URLs, but you can provide a URL instance * Test file paths within shared workers are now file:// URLs * Error serialization and code excerpts now support ESM * Title prefixes in the reporters now correctly skip all test file extensions, not just `js` * CI: Increase delay on timeout test, mostly for Windows
- Loading branch information
1 parent
b8f5685
commit c57067b
Showing
476 changed files
with
2,880 additions
and
2,779 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
{ | ||
"ignores": [ | ||
"media/**", | ||
"test/config/fixtures/config-errors/test.js", | ||
"test-tap/fixture/snapshots/test-sourcemaps/build/**", | ||
"test-tap/fixture/report/edgecases/ast-syntax-error.cjs" | ||
], | ||
"rules": { | ||
"import/no-anonymous-default-export": "off", | ||
"import/no-mutable-exports": "off", | ||
"import/order": [ | ||
"error", | ||
{ | ||
"alphabetize": { | ||
"order": "asc" | ||
}, | ||
"newlines-between": "always" | ||
} | ||
], | ||
"import/newline-after-import": "error", | ||
"node/no-unsupported-features/es-syntax": "off", | ||
"no-use-extend-native/no-use-extend-native": "off" | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": "index.d.ts", | ||
"rules": { | ||
"@typescript-eslint/member-ordering": "off", | ||
"@typescript-eslint/method-signature-style": "off", | ||
"@typescript-eslint/prefer-readonly-parameter-types": "off", | ||
"@typescript-eslint/prefer-function-type": "off", | ||
"@typescript-eslint/unified-signatures": "off" | ||
} | ||
}, | ||
{ | ||
"files": "plugin.d.ts", | ||
"rules": { | ||
"node/prefer-global/url": "off" | ||
} | ||
}, | ||
{ | ||
"files": "test-{d,tap}/**/*.ts", | ||
"rules": { | ||
"@typescript-eslint/explicit-function-return-type": "off", | ||
"@typescript-eslint/no-empty-function": "off", | ||
"@typescript-eslint/no-unsafe-call": "off", | ||
"@typescript-eslint/no-unsafe-member-access": "off", | ||
"@typescript-eslint/no-unsafe-return": "off", | ||
"@typescript-eslint/no-unused-vars": "off", | ||
"@typescript-eslint/prefer-readonly-parameter-types": "off", | ||
"import/extensions": "off", | ||
"no-unused-vars": "off" | ||
} | ||
}, | ||
{ | ||
"files": "test-tap/**/*.js", | ||
"rules": { | ||
"promise/prefer-await-to-then": "off", | ||
"unicorn/error-message": "off", | ||
"unicorn/no-array-reduce": "off", | ||
"unicorn/prevent-abbreviations": "off" | ||
} | ||
}, | ||
{ | ||
"files": [ | ||
"test-tap/fixture/**", | ||
"test/**/fixtures/**" | ||
], | ||
"rules": { | ||
"ava/no-todo-test": "off", | ||
"import/no-extraneous-dependencies": "off", | ||
"import/no-unresolved": "off" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!/usr/bin/env node | ||
import * as cli from '../lib/cli.js'; // eslint-disable-line import/extensions | ||
cli.run(); | ||
import run from '../lib/cli.js'; | ||
|
||
run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
'use strict'; | ||
module.exports = require('../lib/worker/main'); | ||
module.exports = require('../lib/worker/main.cjs'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
import test from '../lib/worker/main.js'; // eslint-disable-line import/extensions | ||
import test from '../lib/worker/main.cjs'; | ||
|
||
export default test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
'use strict'; | ||
module.exports = require('../lib/worker/plugin'); | ||
module.exports = require('../lib/worker/plugin.cjs'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
'use strict'; | ||
import * as plugin from '../lib/worker/plugin.js'; // eslint-disable-line import/extensions | ||
import * as plugin from '../lib/worker/plugin.cjs'; | ||
|
||
const {registerSharedWorker} = plugin; | ||
export {registerSharedWorker}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,16 @@ | ||
'use strict'; | ||
const chalk = require('chalk'); | ||
import chalk from 'chalk'; | ||
|
||
let ctx = null; | ||
exports.get = () => { | ||
if (!ctx) { | ||
throw new Error('Chalk has not yet been configured'); | ||
} | ||
let instance = new chalk.Instance(); | ||
export default instance; | ||
|
||
return ctx; | ||
}; | ||
export {instance as chalk}; | ||
|
||
exports.set = options => { | ||
if (ctx) { | ||
let configured = false; | ||
export function set(options) { | ||
if (configured) { | ||
throw new Error('Chalk has already been configured'); | ||
} | ||
|
||
ctx = new chalk.Instance(options); | ||
return ctx; | ||
}; | ||
configured = true; | ||
instance = new chalk.Instance(options); | ||
} |
Oops, something went wrong.