Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBatdorf committed Sep 29, 2024
1 parent 4503258 commit 48cf2db
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 60 deletions.
60 changes: 0 additions & 60 deletions .eslintrc

This file was deleted.

105 changes: 105 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
import { fixupConfigRules } from "@eslint/compat";
import noOnlyTests from "eslint-plugin-no-only-tests";
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";

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: ["**/node_modules/", "**/pkg/", "**/build/"],
}, ...fixupConfigRules(compat.extends(
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:jsx-a11y/recommended",
"plugin:cypress/recommended",
"prettier",
)), {
plugins: {
"no-only-tests": noOnlyTests,
},

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

parser: tsParser,
ecmaVersion: 5,
sourceType: "module",

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

allowImportExportEverywhere: true,
},
},

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

rules: {
"require-await": "error",

quotes: ["error", "single", {
avoidEscape: true,
}],

"comma-dangle": ["error", "always-multiline"],
"array-element-newline": ["error", "consistent"],

"no-constant-condition": ["error", {
checkLoops: true,
}],

"no-multi-spaces": ["error"],
semi: ["error", "always"],
"space-in-parens": ["error", "never"],

"key-spacing": ["error", {
afterColon: true,
}],

"no-only-tests/no-only-tests": "warn",
"space-infix-ops": ["error"],

"space-before-function-paren": ["error", {
anonymous: "always",
named: "never",
asyncArrow: "always",
}],

"react/react-in-jsx-scope": "off",
"quote-props": ["error", "as-needed"],

"no-multiple-empty-lines": ["error", {
max: 1,
}],

"@typescript-eslint/no-var-requires": "off",

"lines-around-comment": ["error", {
beforeBlockComment: true,
allowBlockStart: true,
}],
},
}];

0 comments on commit 48cf2db

Please sign in to comment.