Skip to content

Commit b86e351

Browse files
committed
fixing lint even harder
1 parent 19c4860 commit b86e351

35 files changed

+30
-113
lines changed

eslint.config.js

Lines changed: 10 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ import js from '@eslint/js';
88
import prettier from 'eslint-config-prettier';
99
import globals from 'globals';
1010
import react from 'eslint-plugin-react';
11-
import babelParser from '@babel/eslint-parser';
1211

1312
export default [
1413
{
15-
files: ['**/*.{js,jsx,ts,tsx}'],
1614
ignores: ['**/node_modules/**', '**/dist/**', '**/build/**', '**/public/**', 'db/**', 'conf/**'],
1715
},
18-
js.configs.recommended,
19-
prettier,
16+
2017
{
18+
files: ['**/*.{js,jsx}'],
2119
languageOptions: {
22-
parser: babelParser,
20+
ecmaVersion: 'latest',
2321
sourceType: 'module',
24-
ecmaVersion: 2021,
22+
parserOptions: {
23+
ecmaFeatures: { jsx: true },
24+
},
2525
globals: {
2626
...globals.browser,
2727
...globals.node,
@@ -32,70 +32,14 @@ export default [
3232
after: 'readonly',
3333
it: 'readonly',
3434
},
35-
parserOptions: { requireConfigFile: false },
3635
},
3736
plugins: { react },
37+
settings: { react: { version: 'detect' } },
3838
rules: {
39-
eqeqeq: [2, 'allow-null'],
40-
strict: 0,
41-
'no-redeclare': [2, { builtinGlobals: false }],
42-
'class-methods-use-this': 'off',
43-
indent: ['off', 2],
44-
'linebreak-style': ['error', 'unix'],
45-
quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: true }],
46-
semi: ['error', 'always'],
39+
...js.configs.recommended.rules,
4740
'no-console': ['error', { allow: ['warn', 'error'] }],
48-
'jsx-quotes': ['error', 'prefer-double'],
49-
'react/display-name': 'off',
50-
'react/forbid-prop-types': 'off',
51-
'react/jsx-closing-bracket-location': 'off',
52-
'react/jsx-curly-spacing': 'off',
53-
'react/jsx-handler-names': ['off', { eventHandlerPrefix: 'handle', eventHandlerPropPrefix: 'on' }],
54-
'react/jsx-indent-props': 'off',
55-
'react/jsx-key': 'off',
56-
'react/jsx-max-props-per-line': 'off',
57-
'react/jsx-no-bind': ['error', { ignoreRefs: true, allowArrowFunctions: true, allowBind: false }],
58-
'react/jsx-no-duplicate-props': ['error', { ignoreCase: true }],
59-
'react/jsx-no-literals': 'off',
60-
'react/jsx-no-undef': 'error',
61-
'react/jsx-pascal-case': ['error', { allowAllCaps: true, ignore: [] }],
62-
'react/sort-prop-types': ['off', { ignoreCase: true, callbacksLast: false, requiredFirst: false }],
63-
'react/jsx-sort-prop-types': 'off',
64-
'react/jsx-sort-props': 'off',
65-
'react/jsx-uses-react': 'error',
66-
'react/jsx-uses-vars': 'error',
67-
'react/no-danger': 'warn',
68-
'react/no-deprecated': 'error',
69-
'react/no-did-mount-set-state': 'error',
70-
'react/no-did-update-set-state': 'warn',
71-
'react/no-direct-mutation-state': 'off',
72-
'react/no-is-mounted': 'error',
73-
'react/no-set-state': 'off',
74-
'react/no-string-refs': 'warn',
75-
'react/no-unknown-property': 'error',
76-
'react/prop-types': ['error', { ignore: [], customValidators: [], skipUndeclared: true }],
77-
'react/react-in-jsx-scope': 'error',
78-
'react/require-extension': 'off',
79-
'react/require-render-return': 'error',
80-
'react/self-closing-comp': 'warn',
81-
'react/sort-comp': 'off',
82-
'react/jsx-wrap-multilines': ['warn', { declaration: true, assignment: true, return: true }],
83-
'react/wrap-multilines': 'off',
84-
'react/jsx-first-prop-new-line': 'off',
85-
'react/jsx-equals-spacing': ['warn', 'never'],
86-
'react/jsx-no-target-blank': 'error',
87-
'react/jsx-filename-extension': ['error', { extensions: ['.jsx'] }],
88-
'react/jsx-no-comment-textnodes': 'error',
89-
'react/no-comment-textnodes': 'off',
90-
'react/no-render-return-value': 'error',
91-
'react/require-optimization': ['off', { allowDecorators: [] }],
92-
'react/no-find-dom-node': 'warn',
93-
'react/forbid-component-props': ['off', { forbid: [] }],
94-
'react/no-danger-with-children': 'error',
95-
'react/no-unused-prop-types': ['warn', { customValidators: [], skipShapeProps: true }],
96-
'react/style-prop-object': 'error',
97-
'react/no-children-prop': 'warn',
9841
},
99-
settings: { react: { version: 'detect' } },
10042
},
43+
44+
prettier,
10145
];

lib/services/extractor/puppeteerExtractor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ puppeteer.use(StealthPlugin());
2222
export default async function execute(url, waitForSelector, options) {
2323
let browser;
2424
let page;
25-
let result = null;
25+
let result;
2626
let userDataDir;
2727
let removeUserDataDir = false;
2828
try {

lib/services/storage/migrations/sql/1.create-fredy-base-structure.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export function up(db) {
8888
}
8989
} catch (e) {
9090
// If parsing fails, let it throw to rollback the migration
91-
throw new Error(`Failed to import users from ${usersJsonPath}: ${e.message}`);
91+
throw new Error(`Failed to import users from ${usersJsonPath}: ${e.message}`, { cause: e });
9292
}
9393
}
9494

@@ -116,7 +116,7 @@ export function up(db) {
116116
}
117117
}
118118
} catch (e) {
119-
throw new Error(`Failed to import jobs from ${jobsJsonPath}: ${e.message}`);
119+
throw new Error(`Failed to import jobs from ${jobsJsonPath}: ${e.message}`, { cause: e });
120120
}
121121
}
122122
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fredy",
3-
"version": "19.3.8",
3+
"version": "19.3.9",
44
"description": "[F]ind [R]eal [E]states [d]amn eas[y].",
55
"scripts": {
66
"prepare": "husky",

ui/src/Index.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* Licensed under Apache-2.0 with Commons Clause and Attribution/Naming Clause
44
*/
55

6-
import React from 'react';
7-
86
import { HashRouter } from 'react-router-dom';
97
import { createRoot } from 'react-dom/client';
108
import en_US from '@douyinfe/semi-ui-19/lib/es/locale/source/en_US';

ui/src/components/ListingDeletionModal.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under Apache-2.0 with Commons Clause and Attribution/Naming Clause
44
*/
55

6-
import React, { useState } from 'react';
6+
import { useState } from 'react';
77
import { Modal, Radio, RadioGroup, Typography } from '@douyinfe/semi-ui-19';
88

99
const { Text } = Typography;

ui/src/components/cards/KpiCard.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Licensed under Apache-2.0 with Commons Clause and Attribution/Naming Clause
44
*/
55

6-
import React from 'react';
76
import { Card, Typography, Space } from '@douyinfe/semi-ui-19';
87
import './DashboardCard.less';
98

ui/src/components/footer/FredyFooter.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Licensed under Apache-2.0 with Commons Clause and Attribution/Naming Clause
44
*/
55

6-
import React from 'react';
76
import './FredyFooter.less';
87
import { useSelector } from '../../services/state/store.js';
98
import { Typography, Layout, Space, Divider } from '@douyinfe/semi-ui-19';

ui/src/components/grid/jobs/JobGrid.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under Apache-2.0 with Commons Clause and Attribution/Naming Clause
44
*/
55

6-
import React, { useState, useEffect, useMemo, useRef } from 'react';
6+
import { useState, useEffect, useMemo, useRef } from 'react';
77
import {
88
Card,
99
Col,

ui/src/components/grid/listings/ListingsGrid.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under Apache-2.0 with Commons Clause and Attribution/Naming Clause
44
*/
55

6-
import React, { useState, useEffect, useMemo } from 'react';
6+
import { useState, useEffect, useMemo } from 'react';
77
import {
88
Card,
99
Col,

0 commit comments

Comments
 (0)