Source code
Revision control
Copy as Markdown
Other Tools
/* Any copyright is dedicated to the Public Domain.
"use strict";
// ------------------------------------------------------------------------------
// Requirements
// ------------------------------------------------------------------------------
var rule = require("../lib/rules/use-console-createInstance");
var RuleTester = require("eslint").RuleTester;
const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: "latest" } });
// ------------------------------------------------------------------------------
// Tests
// ------------------------------------------------------------------------------
ruleTester.run("use-console-createInstance", rule, {
invalid: [
{
code: '"resource://gre/modules/Console.sys.mjs"',
errors: [
{
messageId: "useConsoleRatherThanModule",
data: { module: "Console.sys.mjs" },
},
],
},
{
code: '"resource://gre/modules/Log.sys.mjs"',
errors: [
{
messageId: "useConsoleRatherThanModule",
data: { module: "Log.sys.mjs" },
},
],
},
],
});