Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump ESLint and related dependencies #2986

Merged
merged 11 commits into from
May 5, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 0 additions & 53 deletions .eslintrc.json

This file was deleted.

77 changes: 77 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// @ts-check

// Todo: Use ES module
const eslint = require('@eslint/js');
const tseslint = require('typescript-eslint');
const reactRefresh = require('eslint-plugin-react-refresh');

const FlatCompat = require('@eslint/eslintrc').FlatCompat;
const compat = new FlatCompat({
baseDirectory: `${__dirname}`
});

module.exports = tseslint.config(
{ ignores: ['eslint.config.js'] },
// eslint.configs.recommended,
...tseslint.configs.recommended,
// TODO: Enable when ready
// {
// plugins: {
// 'react-refresh': reactRefresh
// },
// rules: {
// 'react-refresh/only-export-components': 'warn'
// }
// },
RichDom2185 marked this conversation as resolved.
Show resolved Hide resolved
...compat.config({
extends: [
'plugin:react-hooks/recommended'
// "plugin:react/recommended",
// "plugin:react/jsx-runtime"
],
plugins: ['simple-import-sort'],
rules: {
'no-restricted-imports': [
'error',
{
paths: [
{
name: 'react-redux',
importNames: [
// TODO: Create typed hook for useDispatch
// "useDispatch",
'useSelector'
],
message: 'Use the typed hook "useTypedSelector" instead.'
}
]
}
],
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-duplicate-enum-values': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/ban-types': [
'error',
{
// TODO: Change this to true someday
extendDefaults: false,
types: {
'React.FunctionComponent': {
message: 'Use React.FC instead',
fixWith: 'React.FC'
}
}
}
],
'simple-import-sort/imports': 'error'
}
})
);
17 changes: 10 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
},
"scripts": {
"analyze": "yarn build --stats; webpack-bundle-analyzer build/bundle-stats.json",
"build": "cross-env EXTEND_ESLINT=true NODE_OPTIONS=--max_old_space_size=8192 craco build",
"build": "cross-env DISABLE_ESLINT_PLUGIN=true NODE_OPTIONS=--max_old_space_size=8192 craco build",
"coverage": "./scripts/coverage-fix.sh do && craco test --coverage && ./scripts/coverage-fix.sh undo",
"format": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix src && prettier --write \"src/**/*.{js,jsx,ts,tsx}\" && prettier --write --parser scss \"src/**/*.scss\"",
"format": "eslint --fix src && prettier --write \"src/**/*.{js,jsx,ts,tsx}\" && prettier --write --parser scss \"src/**/*.scss\"",
"format:tsx": "prettier --list-different \"src/**/*.{js,jsx,ts,tsx}\"",
"format:scss": "prettier --list-different --parser scss \"src/**/*.scss\"",
"format:ci": "yarn run format:tsx && yarn run format:scss",
"start": "cross-env EXTEND_ESLINT=true BROWSER=none PORT=8000 craco start",
"start": "cross-env DISABLE_ESLINT_PLUGIN=true BROWSER=none PORT=8000 craco start",
"test": "cross-env TZ=UTF-8 craco test",
"test-coveralls": "./scripts/test-coveralls.sh",
"update-ui-snapshots": "jest --updateSnapshot",
"eslint": "eslint --ext \".js,.jsx,.ts,.tsx\" src",
"eslint": "eslint src",
"prepare": "husky"
},
"dependencies": {
Expand Down Expand Up @@ -132,15 +132,17 @@
"@types/showdown": "^2.0.1",
"@types/uuid": "^9.0.0",
"@types/xml2js": "^0.4.11",
"@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^7.4.0",
"babel-jest": "^29.7.0",
"buffer": "^6.0.3",
"canvas": "^2.11.2",
"constants-browserify": "^1.0.0",
"coveralls": "^3.1.1",
"cross-env": "^7.0.3",
"eslint": "^8.57.0",
"eslint": "^9.1.1",
"eslint-plugin-react": "^7.34.1",
"//": "See: https://github.com/facebook/react/issues/28313#issuecomment-2076798972, https://github.com/t3-oss/create-t3-turbo/issues/984#issuecomment-2076413457",
RichDom2185 marked this conversation as resolved.
Show resolved Hide resolved
"eslint-plugin-react-hooks": "5.1.0-canary-cb151849e1-20240424",
"eslint-plugin-react-refresh": "^0.4.6",
"eslint-plugin-simple-import-sort": "^12.0.0",
"https-browserify": "^1.0.0",
"husky": "^9.0.0",
Expand All @@ -159,6 +161,7 @@
"stream-http": "^3.2.0",
"timers-browserify": "^2.0.12",
"typescript": "^5.4.3",
"typescript-eslint": "^7.8.0",
"url": "^0.11.1",
"webpack-bundle-analyzer": "^4.9.0"
},
Expand Down
1 change: 0 additions & 1 deletion src/commons/XMLParser/XMLParserHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ const makeAssessment = (result: any): [Assessment, number] => {
};

const altEval = (str: string): any => {
// eslint-disable-next-line no-new-func
return Function('"use strict";return (' + str + ')')();
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ const removeSpaces = (str: string | number) => {
};

const altEval = (str: string): any => {
// eslint-disable-next-line no-new-func
return Function('"use strict";return (' + str + ')')();
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { Button, H2, Intent } from '@blueprintjs/core';
import { ColDef, GridApi, GridReadyEvent, ValueFormatterFunc } from 'ag-grid-community';
import { AgGridReact } from 'ag-grid-react';
Expand Down
1 change: 0 additions & 1 deletion src/service-worker.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference lib="webworker" />
/* eslint-disable no-restricted-globals */

import { clientsClaim } from 'workbox-core';
import { createHandlerBoundToURL, precacheAndRoute } from 'workbox-precaching';
Expand Down
Loading
Loading