Skip to content

Commit 2c68942

Browse files
authored
Merge pull request #19534 from mozilla/fix-fxa-react-eslint
polish(fxa-react): Fix eslint in fxa-react
2 parents b1a42e5 + f48996f commit 2c68942

18 files changed

Lines changed: 79 additions & 39 deletions

File tree

packages/fxa-react/.eslintrc.json

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,38 @@
11
{
2-
"extends": ["plugin:fxa/recommended"],
3-
"plugins": ["fxa"],
4-
"parserOptions": {
5-
"ecmaVersion": "2020",
6-
"sourceType": "module"
7-
},
8-
"env": {
9-
"browser": true,
10-
"jest": true
11-
},
2+
"root": true,
3+
"extends": ["react-app", "react-app/jest"],
4+
"plugins": ["header"],
125
"rules": {
13-
"require-atomic-updates": "off",
14-
"space-unary-ops": "off",
15-
"no-useless-escape": "off"
6+
"import/export": "error",
7+
"import/named": "off",
8+
"import/no-deprecated": "error",
9+
"import/no-named-as-default-member": "off",
10+
"import/no-unresolved": "off",
11+
"jest/no-jest-import": "off",
12+
"jest/valid-describe": "off",
13+
"testing-library/no-wait-for-multiple-assertions": "off",
14+
"testing-library/no-render-in-setup": "off",
15+
"testing-library/prefer-find-by": "off",
16+
"testing-library/no-wait-for-side-effects": "off",
17+
"testing-library/prefer-presence-queries": "off",
18+
"testing-library/no-node-access": "off",
19+
"testing-library/render-result-naming-convention": "off",
20+
"testing-library/prefer-screen-queries": "off",
21+
"testing-library/no-unnecessary-act": "off",
22+
"testing-library/no-container": "off",
23+
"header/header": [
24+
2, "block",
25+
" This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. "
26+
]
1627
},
17-
"ignorePatterns": [
18-
"dist",
19-
"node_modules",
20-
"pm2.config.js",
21-
"storybook-static"
28+
"overrides": [
29+
{
30+
"files": ["*.ts", "*.tsx"],
31+
"rules": {
32+
"no-unused-vars": "off",
33+
"@typescript-eslint/no-unused-vars": "error"
34+
}
35+
}
2236
],
23-
"root": true
37+
"ignorePatterns": ["build/", "scripts/build.js", "dist/"]
2438
}

packages/fxa-react/Gruntfile.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
'use strict';
6-
75
module.exports = function (grunt) {
86
const srcPaths = [
97
'components/**/*.ftl',

packages/fxa-react/components/AppErrorDialog/index.stories.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4+
15
import React from 'react';
26
import { storiesOf } from '@storybook/react';
37
import AppErrorDialog from './index';

packages/fxa-react/components/AppErrorDialog/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
import React, { ReactNode } from 'react';
5+
import React from 'react';
66
import { Localized } from '@fluent/react';
77

88
export type ErrorType = 'general' | 'query-parameter-violation';

packages/fxa-react/components/Header/index.stories.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
14
import React from 'react';
25
import { storiesOf } from '@storybook/react';
36
import { Header } from './index';

packages/fxa-react/components/LinkExternal/index.stories.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
14
import React from 'react';
25
import { storiesOf } from '@storybook/react';
36
import LinkExternal from './index';

packages/fxa-react/components/LoadingSpinner/index.stories.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
14
import React from 'react';
25
import { storiesOf } from '@storybook/react';
36
import LoadingSpinner, { SpinnerType } from './index';

packages/fxa-react/components/LoadingSpinner/index.test.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
14
import React from 'react';
25
import { screen } from '@testing-library/react';
36

@@ -30,7 +33,7 @@ it('renders blue spinner as expected', () => {
3033
expect(spinnerType).toBeInTheDocument();
3134
});
3235

33-
it('renders blue spinner as expected', () => {
36+
it('renders white spinner as expected', () => {
3437
renderWithLocalizationProvider(
3538
<LoadingSpinner spinnerType={SpinnerType.White} />
3639
);

packages/fxa-react/components/LoadingSpinner/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
14
import { useLocalization } from '@fluent/react';
25
import React from 'react';
36
import classNames from 'classnames';

packages/fxa-react/components/LogoLockup/index.test.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
14
import React from 'react';
25
import LogoLockup from '.';
36
import { renderWithLocalizationProvider } from '../../lib/test-utils/localizationProvider';

0 commit comments

Comments
 (0)