Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ed3707c

Browse files
Reconfigure ESLint
1 parent d574245 commit ed3707c

20 files changed

+581
-2114
lines changed

‎.eslintrc.js

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
module.exports = {
2-
extends: ['airbnb-typescript', 'prettier'],
2+
extends: ['airbnb','airbnb-typescript', 'prettier'],
33

44
parserOptions: {
55
project: './tsconfig.eslint.json',
66
},
77

8-
// ecmaFeatures: {
9-
// jsx: true,
10-
// },
11-
128
env: {
139
es6: true,
1410
},
@@ -19,12 +15,12 @@ module.exports = {
1915
},
2016
},
2117

22-
// rules: {
23-
// 'max-params': ['error', 10],
24-
// 'no-warning-comments': 'error',
25-
26-
// 'import/no-commonjs': 'off',
27-
// },
18+
rules: {
19+
'import/no-cycle': 'off', // TODO: We have to fix our cycle issue before being able to activate it again
20+
'no-underscore-dangle': 'off',
21+
'prefer-destructuring': 'off',
22+
'react/jsx-fragments': 'off',
23+
},
2824

2925
overrides: [
3026
{

‎package.json

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,33 +30,34 @@
3030
"@babel/preset-env": "7.15.6",
3131
"@babel/preset-react": "7.14.5",
3232
"@babel/preset-typescript": "^7.15.0",
33-
"@commitlint/cli": "8.3.5",
34-
"@commitlint/config-angular": "8.3.4",
3533
"@types/enzyme": "^3.10.9",
3634
"@types/enzyme-adapter-react-16": "^1.0.6",
3735
"@types/jest": "^27.0.2",
3836
"@types/react": "^17.0.26",
3937
"@types/react-is": "^17.0.2",
38+
"@typescript-eslint/eslint-plugin": "^4.29.3",
39+
"@typescript-eslint/parser": "^4.29.3",
4040
"babel-eslint": "10.1.0",
41-
"babel-jest": "24.9.0",
41+
"babel-jest": "27.2.4",
4242
"babel-register": "6.26.0",
4343
"conventional-changelog-cli": "2.1.1",
4444
"doctoc": "1.4.0",
4545
"enzyme": "3.11.0",
4646
"enzyme-adapter-react-16": "1.15.6",
47-
"eslint": "7.25.0",
48-
"eslint-config-airbnb-typescript": "12.3.1",
49-
"eslint-config-algolia": "14.0.1",
47+
"eslint": "7.32.0",
48+
"eslint-config-airbnb": "^18.2.1",
49+
"eslint-config-airbnb-typescript": "^14.0.0",
50+
"eslint-config-algolia": "19.0.2",
5051
"eslint-config-prettier": "8.3.0",
51-
"eslint-plugin-import": "2.22.1",
52-
"eslint-plugin-jest": "22.21.0",
52+
"eslint-plugin-import": "2.24.2",
53+
"eslint-plugin-jest": "24.5.0",
5354
"eslint-plugin-jsx-a11y": "6.4.1",
54-
"eslint-plugin-react": "7.23.2",
55+
"eslint-plugin-react": "7.26.1",
5556
"eslint-plugin-react-hooks": "4.2.0",
5657
"esm": "3.2.25",
57-
"expect": "27.2.3",
58+
"expect": "27.2.4",
5859
"husky": "3.1.0",
59-
"jest": "27.2.3",
60+
"jest": "27.2.4",
6061
"json": "10.0.0",
6162
"lint-staged": "10.5.4",
6263
"mversion": "2.0.1",

‎src/AnonymousStatelessComponent.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import React from 'react';// eslint-disable-next-line react/display-name
1+
import React from 'react';
22

3+
// eslint-disable-next-line func-names
34
export default function (props: { children: React.ReactNode }) {
45
const { children } = props; // eslint-disable-line react/prop-types
56

‎src/formatter/createPropFilter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ export default function createPropFilter(
44
) {
55
if (Array.isArray(filter)) {
66
return (key: string) => filter.indexOf(key) === -1;
7-
} else {
8-
// @ts-expect-error: flow to TS
9-
return (key: string) => filter(props[key], key);
107
}
8+
9+
// @ts-expect-error: flow to TS
10+
return (key: string) => filter(props[key], key);
1111
}

‎src/formatter/formatComplexDataStructure.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { isValidElement } from 'react';
22
import { prettyPrint } from '@base2/pretty-print-object';
33
import sortObject from './sortObject';
4-
import parseReactElement from './../parser/parseReactElement';
4+
import parseReactElement from '../parser/parseReactElement';
55
import formatTreeNode from './formatTreeNode';
66
import formatFunction from './formatFunction';
77
import spacer from './spacer';
8-
import type { Options } from './../options';
8+
import type { Options } from '../options';
99

1010
export default (
1111
value: Record<string, any> | Array<any>,

‎src/formatter/formatFunction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Options } from './../options';
1+
import type { Options } from '../options';
22

33
function noRefCheck() {}
44

‎src/formatter/formatProp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import spacer from './spacer';
22
import formatPropValue from './formatPropValue';
3-
import type { Options } from './../options';
3+
import type { Options } from '../options';
44

55
export default (
66
name: string,

‎src/formatter/formatPropValue.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import formatPropValue from './formatPropValue';
3-
import parseReactElement from './../parser/parseReactElement';
3+
import parseReactElement from '../parser/parseReactElement';
44
import formatTreeNode from './formatTreeNode';
55
import formatComplexDataStructure from './formatComplexDataStructure';
66

‎src/formatter/formatPropValue.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { isValidElement } from 'react';
33
import formatComplexDataStructure from './formatComplexDataStructure';
44
import formatFunction from './formatFunction';
55
import formatTreeNode from './formatTreeNode';
6-
import type { Options } from './../options';
7-
import parseReactElement from './../parser/parseReactElement';
6+
import type { Options } from '../options';
7+
import parseReactElement from '../parser/parseReactElement';
88

99
const escape = (s: string): string => s.replace(/"/g, '&quot;');
1010

@@ -49,7 +49,7 @@ const formatPropValue = (
4949
}
5050

5151
if (propValue instanceof Date) {
52-
if (isNaN(propValue.valueOf())) {
52+
if (Number.isNaN(propValue.valueOf())) {
5353
return `{new Date(NaN)}`;
5454
}
5555

‎src/formatter/formatReactElementNode.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import formatProp from './formatProp';
44
import mergeSiblingPlainStringChildrenReducer from './mergeSiblingPlainStringChildrenReducer';
55
import sortPropsByNames from './sortPropsByNames';
66
import createPropFilter from './createPropFilter';
7-
import type { Options } from './../options';
8-
import type { ReactElementTreeNode } from './../tree';
7+
import type { Options } from '../options';
8+
import type { ReactElementTreeNode } from '../tree';
99

1010
const compensateMultilineStringElementIndentation = (
1111
element: any,

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /