Skip to content

Commit

Permalink
Merge pull request #20 from nzakas/main
Browse files Browse the repository at this point in the history
upgrade to ESLint 9
  • Loading branch information
barbalex authored May 24, 2024
2 parents e67f659 + 6a46903 commit f30cf2d
Show file tree
Hide file tree
Showing 5 changed files with 235 additions and 208 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

45 changes: 0 additions & 45 deletions .eslintrc.cjs

This file was deleted.

73 changes: 73 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import reactRefresh from "eslint-plugin-react-refresh";
import _import from "eslint-plugin-import";
import globals from "globals";
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";
import { fixupConfigRules } from "@eslint/compat";
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: [
"**/dist",
"**/*.mjs",
"src/generated",
"src/components/Map/TileLayers/TileLayer/WMTS.tsx",
"src/components/Map/TileLayers/TileLayer/WMTSOffline.tsx",
],
}, ...fixupConfigRules(compat.extends(
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/stylistic",
"plugin:react-hooks/recommended",
)), {
plugins: {
"react-refresh": reactRefresh,
import: _import,
},

languageOptions: {
globals: {
...globals.browser,
},

parser: tsParser,
},

rules: {
strict: 0,
"react/prop-types": 0,
"react/display-name": "off",
"no-console": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"@typescript-eslint/no-unused-vars": ["error"],
"@typescript-eslint/consistent-type-definitions": "off",

"no-empty": ["error", {
allowEmptyCatch: true,
}],

"react/react-in-jsx-scope": "off",

"react-refresh/only-export-components": ["warn", {
allowConstantExport: true,
}],

"import/extensions": ["warn", "ignorePackages", {
js: "never",
jsx: "never",
tsx: "never",
}],
},
}];
Loading

0 comments on commit f30cf2d

Please sign in to comment.