eslint: Forbid CommonJS variables in ES6 modules.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2021-03-23 00:42:16 -07:00 committed by Tim Abbott
parent 830c4acedc
commit 9553f11387
9 changed files with 12 additions and 15 deletions

View File

@ -209,7 +209,6 @@
"files": ["static/**"],
"env": {
"browser": true,
"commonjs": true,
"node": false
},
"rules": {
@ -223,7 +222,6 @@
"files": ["static/shared/**"],
"env": {
"browser": false,
"commonjs": false,
"shared-node-browser": true
},
"rules": {

View File

@ -1,6 +1,5 @@
"use strict";
const Module = require("module");
const path = require("path");
require("css.escape");
@ -52,11 +51,6 @@ handlebars.hook_require();
const noop = function () {};
// Set up fake module.hot
Module.prototype.hot = {
accept: noop,
};
function short_tb(tb) {
const lines = tb.split("\n");

View File

@ -1,3 +1,5 @@
/* eslint-env commonjs */
"use strict";
module.exports = {

View File

@ -1,12 +1,12 @@
import $ from "jquery";
import render_confirm_delete_user_avatar from "../templates/confirm_delete_user_avatar.hbs";
import * as channel from "./channel";
import * as confirm_dialog from "./confirm_dialog";
import * as settings_data from "./settings_data";
import * as upload_widget from "./upload_widget";
const render_confirm_delete_user_avatar = require("../templates/confirm_delete_user_avatar.hbs");
export function build_bot_create_widget() {
// We have to do strange gyrations with the file input to clear it,
// where we replace it wholesale, so we generalize the file input with

View File

@ -1,10 +1,5 @@
import $ from "jquery";
// This reloads the module in development rather than refreshing the page
if (module.hot) {
module.hot.accept();
}
export const status_classes = "alert-error alert-success alert-info alert-warning";
// TODO: Move this to the portico codebase.

View File

@ -1,3 +1,5 @@
/* eslint-env commonjs */
"use strict";
const $ = require("jquery");

View File

@ -1,3 +1,5 @@
/* eslint-env commonjs */
"use strict";
// Media query breakpoints according to Bootstrap 4.5

View File

@ -1,3 +1,5 @@
/* eslint-env commonjs */
"use strict";
const $ = require("jquery");

View File

@ -1,3 +1,5 @@
/* eslint-env commonjs */
"use strict";
const {Filter} = require("./filter");