Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Sweeping the JS lint errors under the rug (#5018)
Browse files Browse the repository at this point in the history
* added eslint ignore on WizInt moderator

* correct use of the ignore

* more ignores

* a bit more

* more

* lint errors < 100

* a bit more

* lint errors < 50

* lint errors < 10

* no more lints

* no more lint errors
  • Loading branch information
mojtaba-komeili committed Apr 20, 2023
1 parent f8863c2 commit 9179d4f
Show file tree
Hide file tree
Showing 29 changed files with 4,042 additions and 2,885 deletions.

Large diffs are not rendered by default.

22 changes: 12 additions & 10 deletions parlai/crowdsourcing/tasks/acute_eval/webapp/webpack.config.js
Expand Up @@ -5,41 +5,43 @@
*/

var path = require("path");
/* eslint-disable no-unused-vars */
var webpack = require("webpack");
/* eslint-enable no-unused-vars */

module.exports = {
entry: "./src/main.js",
output: {
path: __dirname,
filename: "build/bundle.js",
hashFunction: "sha256",
hashFunction: "sha256"
},
resolve: {
alias: {
react: path.resolve("./node_modules/react"),
},
react: path.resolve("./node_modules/react")
}
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
loader: "babel-loader",
exclude: /node_modules/,
options: { presets: ["@babel/env"] },
options: { presets: ["@babel/env"] }
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"],
use: ["style-loader", "css-loader"]
},
{
test: /\.(svg|png|jpe?g|ttf)$/,
loader: "url-loader",
options: { limit: 100000 },
options: { limit: 100000 }
},
{
test: /\.jpg$/,
loader: "file-loader",
},
],
},
loader: "file-loader"
}
]
}
};
Expand Up @@ -7,6 +7,8 @@ import React from "react";
import { Input, Form, Button } from "antd";
import { SketchPicker } from "react-color";

/* eslint-disable no-unused-vars */

class ColorPicker extends React.Component {
/* Args:
form
Expand Down Expand Up @@ -153,4 +155,6 @@ class ColorPicker extends React.Component {
}
}

/* eslint-enable no-unused-vars */

export default ColorPicker;
Expand Up @@ -3,6 +3,10 @@
* Carnegie Mellon University 2022
*********************************************/

/* eslint-disable no-unused-vars */
/* eslint-disable react/no-unescaped-entities */
/* eslint-disable react/jsx-key */

import React, { Component } from "react";
import {
Button,
Expand Down Expand Up @@ -61,7 +65,7 @@ class Configure extends Component {
questionFeedbacks: [] /* Feedback questions. */,
questionSystems: [] /* System specific questions. */,
loading: true
/* Indicate the loading state. It will be false after
/* Indicate the loading state. It will be false after
data is copied from `this.makeProps` */
};

Expand Down Expand Up @@ -362,10 +366,11 @@ class Configure extends Component {
}
}

/* eslint-disable react/require-render-return */
render() {
throw "Not implemented!";
return null;
}
/* eslint-enable react/require-render-return */

_showGeneralConfig() {
const { formItemLayout, formItemLayoutWithOutLabel } = this;
Expand Down Expand Up @@ -1029,7 +1034,7 @@ class Configure extends Component {

_showAppearanceConfig(textStyleExtras = []) {
/* Params:
{@Array} textStyleExtras: Specify extra text style configuration.
{@Array} textStyleExtras: Specify extra text style configuration.
Check the variable `textStyles` for the format of its elements.
*/
const { formItemLayout, formItemLayoutWithOutLabel } = this;
Expand Down Expand Up @@ -1237,4 +1242,8 @@ function calcNoHits(nUnit, nAssignment, nconvo) {
}
}

/* eslint-enable react/jsx-key */
/* eslint-enable react/no-unescaped-entities */
/* eslint-enable no-unused-vars */

export default Configure;
Expand Up @@ -21,7 +21,7 @@ class FontPicker extends React.Component {
/* Args:
form
{@Array} keys: Path to the config. e.g ['style', 'instruction'].
{@Function} updateByKey:
{@Function} updateByKey:
{@String} fontFamily
{@String} fontSize
{@String} color
Expand Down Expand Up @@ -272,9 +272,11 @@ class FontPicker extends React.Component {
);
}

/* eslint-disable no-unused-vars */
handleColorPickerChange(color, event) {
this.color = color;
}
/* eslint-enable no-unused-vars */

showPicker() {
const popover = {
Expand All @@ -288,14 +290,6 @@ class FontPicker extends React.Component {
position: "absolute"
};

const cover = {
position: "fixed",
top: "0px",
right: "0px",
bottom: "0px",
left: "0px"
};

if (this.state.visiblePicker) {
return (
<>
Expand All @@ -319,7 +313,7 @@ class FontPicker extends React.Component {
}

function path2Name(path) {
/* Convert a path to name of a form item.
/* Convert a path to name of a form item.
Args:
{@Array} path
Return: {@String}
Expand Down

0 comments on commit 9179d4f

Please sign in to comment.