Compare commits

..

2 Commits

Author SHA1 Message Date
7ff8a99505 Merge pull request 'feat: add eslint (#12)' (#15) from feature/eslint into main
Reviewed-on: #15
2024-11-03 12:28:50 +03:00
RustamRu
43c283ed0e feat: add eslint (#12) 2024-11-03 12:23:47 +03:00
7 changed files with 2590 additions and 14 deletions

View File

@ -1,3 +1,5 @@
/* eslint-disable no-undef */
/* eslint-disable @typescript-eslint/no-require-imports */
const pkg = require("./package");
module.exports = {

39
eslint.config.mjs Normal file
View File

@ -0,0 +1,39 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import pluginReact from "eslint-plugin-react";
import stylistic from '@stylistic/eslint-plugin';
export default [
{ files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"] },
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
{
plugins: {
'@stylistic': stylistic
},
"rules": {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn", // or "error"
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}
],
"sort-imports": ["error", {
"ignoreCase": false,
"ignoreDeclarationSort": true,
"ignoreMemberSort": true,
"memberSyntaxSortOrder": ["none", "all", "multiple", "single"],
"allowSeparatedGroups": true
}],
semi: ["error", "always"],
'@stylistic/indent': ['error', 2],
'react/prop-types': 'off'
},
}
];

2544
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,10 @@
"start": "brojs server --port=8099 --with-open-browser",
"build": "npm run clean && brojs build --dev",
"build:prod": "npm run clean && brojs build",
"clean": "rimraf dist"
"clean": "rimraf dist",
"eslint": "npx eslint .",
"eslint:fix": "npx eslint . --fix",
"preversion": "npm run eslint"
},
"keywords": [],
"author": "",
@ -27,7 +30,13 @@
"react-router-dom": "^6.27.0"
},
"devDependencies": {
"@eslint/js": "^9.14.0",
"@stylistic/eslint-plugin": "^2.10.1",
"@types/react-dom": "^18.3.1",
"prettier": "3.3.3"
"eslint": "^9.14.0",
"eslint-plugin-react": "^7.37.2",
"globals": "^15.11.0",
"prettier": "3.3.3",
"typescript-eslint": "^8.12.2"
}
}

View File

@ -32,7 +32,7 @@ const Masters = () => {
<Thead>
<Tr>
{TABLE_HEADERS.map((name) => (
<Th>{name}</Th>
<Th key={name}>{name}</Th>
))}
</Tr>
</Thead>

View File

@ -1,4 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable react/display-name */
import React from 'react';
import ReactDOM from 'react-dom/client';

View File

@ -1,3 +1,5 @@
/* eslint-disable no-undef */
/* eslint-disable @typescript-eslint/no-require-imports */
const router = require('express').Router();
module.exports = router;