Skip to content

Commit

Permalink
chore: Update to eslint v9 (#525)
Browse files Browse the repository at this point in the history
* chore(deps-dev): bump the eslint group across 1 directory with 2 updates

Bumps the eslint group with 2 updates in the /assets directory: [eslint](https://github.com/eslint/eslint) and [eslint-plugin-react-hooks](https://github.com/facebook/react/tree/HEAD/packages/eslint-plugin-react-hooks).


Updates `eslint` from 8.57.0 to 9.12.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](eslint/eslint@v8.57.0...v9.12.0)

Updates `eslint-plugin-react-hooks` from 4.6.2 to 5.0.0
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/[email protected]/packages/eslint-plugin-react-hooks)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: eslint
- dependency-name: eslint-plugin-react-hooks
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: eslint
...

Signed-off-by: dependabot[bot] <[email protected]>

* Migrate config file to new format.

* Fix lint issues.

* File format.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
cmaddox5 and dependabot[bot] authored Nov 15, 2024
1 parent e6f30ed commit 6e323da
Show file tree
Hide file tree
Showing 9 changed files with 537 additions and 375 deletions.
6 changes: 0 additions & 6 deletions assets/.eslintignore

This file was deleted.

48 changes: 0 additions & 48 deletions assets/.eslintrc.js

This file was deleted.

97 changes: 97 additions & 0 deletions assets/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import { fixupConfigRules, fixupPluginRules } from "@eslint/compat";
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import react from "eslint-plugin-react";
import jsxA11Y from "eslint-plugin-jsx-a11y";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [
{
ignores: [
"**/webpack.config.js",
"**/.eslintrc.js",
"**/socket.js",
"**/node_modules",
"**/coverage",
],
},
...fixupConfigRules(
compat.extends(
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:jsx-a11y/recommended",
"plugin:react-hooks/recommended",
),
),
{
plugins: {
"@typescript-eslint": fixupPluginRules(typescriptEslint),
react: fixupPluginRules(react),
"jsx-a11y": fixupPluginRules(jsxA11Y),
},

linterOptions: {
reportUnusedDisableDirectives: true,
},

languageOptions: {
parser: tsParser,
ecmaVersion: 5,
sourceType: "script",

parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},

settings: {
react: {
version: "detect",
},
},

rules: {
"no-console": 0,
"prefer-rest-params": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "off",

"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_.*",
varsIgnorePattern: "^_.*",
destructuredArrayIgnorePattern: "^_.*",
},
],

"react/display-name": "off",

"react/function-component-definition": [
"error",
{
namedComponents: "arrow-function",
unnamedComponents: "arrow-function",
},
],

"react/no-danger": "error",
"jsx-a11y/no-static-element-interactions": "off",
"jsx-a11y/click-events-have-key-events": "off",
},
},
];
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable react/prop-types */
import React from "react";
import PastAlertDetails from "./PastAlertDetails";
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable react/prop-types */
import React from "react";
import ConfirmationPage from "./ConfirmationPage";
import CreateMessage from "./CreateMessage";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable react/prop-types */
import React from "react";

import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable react/prop-types */
import React from "react";
import StackedStationCards from "./StackedStationCards";

Expand Down
Loading

0 comments on commit 6e323da

Please sign in to comment.