Skip to content

Commit

Permalink
Use new eslint format
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasbruvik committed Apr 8, 2024
1 parent 8169ed2 commit 5969ce7
Show file tree
Hide file tree
Showing 4 changed files with 190 additions and 436 deletions.
44 changes: 0 additions & 44 deletions .eslintrc.json

This file was deleted.

11 changes: 6 additions & 5 deletions Src/WitsmlExplorer.Frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"lint": "eslint . --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"test": "vitest run",
"test:watch": "vitest watch"
Expand Down Expand Up @@ -58,6 +58,7 @@
"uuid": "^9.0.0"
},
"devDependencies": {
"@eslint/eslintrc": "^3.0.2",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
Expand All @@ -70,13 +71,13 @@
"@types/react-window": "^1.8.5",
"@types/styled-components": "^5.1.26",
"@types/uuidv4": "^5.0.0",
"@typescript-eslint/eslint-plugin": "^7.3.1",
"@typescript-eslint/parser": "^7.3.1",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^9.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^27.9.0",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-jest": "^28.2.0",
"eslint-plugin-react": "^6.2.2",
"jsdom": "^24.0.0",
"lint-staged": "^13.0.3",
"typescript": "^5.4.3",
Expand Down
46 changes: 46 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
const js = require("@eslint/js");
const globals = require("globals");
const typescriptEslintPlugin = require("@typescript-eslint/eslint-plugin");
const typescriptEslintParser = require("@typescript-eslint/parser");
const reactEslintPlugin = require("eslint-plugin-react");
const prettierConfig = require("eslint-config-prettier");

module.exports = [
js.configs.recommended,
prettierConfig,
{
settings: {
react: {
version: "detect",
},
},
languageOptions: {
globals: globals.node,
ecmaVersion: 2021,
sourceType: "module",
parser: typescriptEslintParser,
// Assuming globals is correctly imported above; otherwise, specify globals manually
},
plugins: {
"react": reactEslintPlugin,
"@typescript-eslint": typescriptEslintPlugin,
},
rules: {
// suppress errors for missing 'import React' in files
"react/react-in-jsx-scope": "off",
// allow jsx syntax in js files (for next.js project)
"react/jsx-filename-extension": ["warn", { extensions: [".js", ".jsx", ".ts", ".tsx"] }],
"react-hooks/exhaustive-deps": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-unused-vars": "error",
"no-console": ["error", { allow: ["warn", "error"] }],
"react/prop-types": 1,
"no-unused-vars": "off",
"no-empty-pattern": "off",
},
},
];
Loading

0 comments on commit 5969ce7

Please sign in to comment.