From ce8b203d7907f8744b050a84797e3456011360b6 Mon Sep 17 00:00:00 2001 From: yosuke ota Date: Mon, 16 Aug 2021 18:53:52 +0900 Subject: [PATCH] [Fix] `no-amd`, `no-commonjs`: fix test cases --- tests/src/rules/no-amd.js | 2 +- tests/src/rules/no-commonjs.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/src/rules/no-amd.js b/tests/src/rules/no-amd.js index 74c89c411..91e29234c 100644 --- a/tests/src/rules/no-amd.js +++ b/tests/src/rules/no-amd.js @@ -2,7 +2,7 @@ import { RuleTester } from 'eslint'; import eslintPkg from 'eslint/package.json'; import semver from 'semver'; -const ruleTester = new RuleTester(); +const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: 2015, sourceType: 'module' } }); ruleTester.run('no-amd', require('rules/no-amd'), { valid: [ diff --git a/tests/src/rules/no-commonjs.js b/tests/src/rules/no-commonjs.js index b1d8c03c1..a2e3464ca 100644 --- a/tests/src/rules/no-commonjs.js +++ b/tests/src/rules/no-commonjs.js @@ -5,7 +5,7 @@ import semver from 'semver'; const EXPORT_MESSAGE = 'Expected "export" or "export default"'; const IMPORT_MESSAGE = 'Expected "import" instead of "require()"'; -const ruleTester = new RuleTester(); +const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: 2015, sourceType: 'module' } }); ruleTester.run('no-commonjs', require('rules/no-commonjs'), { valid: [