Skip to content

Commit

Permalink
eslint working begin the carnage
Browse files Browse the repository at this point in the history
ignore magic 0 1 -1

tmp checkpoint commit

fixed all lint errors

rebased
  • Loading branch information
lowtorola committed Nov 25, 2024
1 parent bda99b5 commit 20c5e98
Show file tree
Hide file tree
Showing 121 changed files with 3,299 additions and 5,002 deletions.
106 changes: 99 additions & 7 deletions frontend2/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,108 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import eslintLoveConfig from "eslint-config-love";
import eslintConfigPrettier from "eslint-config-prettier";
import tseslint from "typescript-eslint";
import react from "eslint-plugin-react";

export default tseslint.config(
eslint.configs.recommended,
export default [
eslintLoveConfig,
react.configs.flat.recommended,
react.configs.flat["jsx-runtime"],
...tseslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
eslintConfigPrettier,

{
languageOptions: {
parser: tseslint.parser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
ecmaFeatures: {
modules: true,
},
ecmaVersion: "latest",
project: "./tsconfig.json",
extraFileExtensions: [".md"],
},
},
plugins: {
"@typescript-eslint": tseslint.plugin,
react,
},
},
{
settings: {
react: {
createClass: "createReactClass", // Regex for Component Factory to use,
// default to "createReactClass"
pragma: "React", // Pragma to use, default to "React"
fragment: "Fragment", // Fragment to use (may be a property of <pragma>), default to "Fragment"
version: "detect", // React version. "detect" automatically picks the version you have installed.
// You can also use `16.0`, `16.3`, etc, if you want to override the detected value.
// It will default to "latest" and warn if missing, and to "detect" in the future
flowVersion: "0.53", // Flow version
},
propWrapperFunctions: [
// The names of any function used to wrap propTypes, e.g. `forbidExtraProps`. If this isn't set, any propTypes wrapped in a function will be skipped.
"forbidExtraProps",
{ property: "freeze", object: "Object" },
{ property: "myFavoriteWrapper" },
// for rules that check exact prop wrappers
{ property: "forbidExtraProps", exact: true },
],
componentWrapperFunctions: [
// The name of any function used to wrap components, e.g. Mobx `observer` function. If this isn't set, components wrapped by these functions will be skipped.
"observer", // `property`
{ property: "styled" }, // `object` is optional
{ property: "observer", object: "Mobx" },
{ property: "observer", object: "<pragma>" }, // sets `object` to whatever value `settings.react.pragma` is set to
],
formComponents: [
// Components used as alternatives to <form> for forms, eg. <Form endpoint={ url } />
"CustomForm",
{ name: "Form", formAttribute: "endpoint" },
],
linkComponents: [
// Components used as alternatives to <a> for linking, eg. <Link to={ url } />
"Hyperlink",
{ name: "Link", linkAttribute: "to" },
],
},
},
);
{
files: ["**/*.{ts,js,tsx,json}"],
rules: {
semi: ["error", "always"], // require semicolons ending statements
"@typescript-eslint/no-unused-vars": [
"warn",
{
varsIgnorePattern: "^_",
argsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-magic-numbers": [
"error",
{ ignore: [0, 1, -1, 2] },
],
"@typescript-eslint/prefer-literal-enum-member": "off",
"@typescript-eslint/prefer-destructuring": [
"error",
{
array: false,
object: true,
},
],
"@typescript-eslint/non-nullable-type-assertion-style": "off",
},
},
{
ignores: [
"**/node_modules/**",
"**/*.json",
"**/src/api/_autogen/**",
"**/tailwind.config.js",
"**/vite.config.ts",
"**/tsconfig.json",
"**/vite-env.d.ts",
],
},
];
38 changes: 18 additions & 20 deletions frontend2/index.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en" class="h-full bg-gray-100">

<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Web site created using create-vite" />
<link rel="apple-touch-icon" href="/logo192.png" />
<!--
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Web site created using create-vite" />
<link rel="apple-touch-icon" href="/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="/manifest.json" />
<title>Battlecode</title>
</head>
<link rel="manifest" href="/manifest.json" />
<title>Battlecode</title>
</head>

<body class="h-full">
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
<body class="h-full">
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
Expand All @@ -29,7 +28,6 @@
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
<script type="module" src="/src/index.tsx"></script>
</body>

<script type="module" src="/src/index.tsx"></script>
</body>
</html>
Loading

0 comments on commit 20c5e98

Please sign in to comment.