mirror of
https://github.com/mozilla/fxa.git
synced 2025-12-13 20:36:41 +01:00
enable husky pre-commit and eslint ts files
This commit is contained in:
2
.husky/pre-commit
Normal file → Executable file
2
.husky/pre-commit
Normal file → Executable file
@@ -1 +1 @@
|
|||||||
lint-staged
|
npx lint-staged
|
||||||
|
|||||||
@@ -145,9 +145,7 @@
|
|||||||
"eslint"
|
"eslint"
|
||||||
],
|
],
|
||||||
"*.{ts,tsx}": [
|
"*.{ts,tsx}": [
|
||||||
"prettier --config _dev/.prettierrc --write"
|
"prettier --config _dev/.prettierrc --write",
|
||||||
],
|
|
||||||
"packages/fxa-auth-server/**/*.{ts,tsx}": [
|
|
||||||
"eslint"
|
"eslint"
|
||||||
],
|
],
|
||||||
"*.css": [
|
"*.css": [
|
||||||
|
|||||||
@@ -1 +1,7 @@
|
|||||||
storybook-static
|
storybook-static
|
||||||
|
.storybook/*.js
|
||||||
|
config/
|
||||||
|
public/
|
||||||
|
scripts/
|
||||||
|
*.config.js
|
||||||
|
Gruntfile.js
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
{
|
{
|
||||||
"root": true,
|
"root": true,
|
||||||
"extends": [
|
"extends": ["react-app", "react-app/jest"],
|
||||||
"react-app",
|
|
||||||
"react-app/jest"
|
|
||||||
],
|
|
||||||
"rules": {
|
"rules": {
|
||||||
"import/export": "error",
|
"import/export": "error",
|
||||||
"import/named": "off",
|
"import/named": "off",
|
||||||
@@ -23,5 +20,14 @@
|
|||||||
"testing-library/no-unnecessary-act": "off",
|
"testing-library/no-unnecessary-act": "off",
|
||||||
"testing-library/no-container": "off"
|
"testing-library/no-container": "off"
|
||||||
},
|
},
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": ["*.ts", "*.tsx"],
|
||||||
|
"rules": {
|
||||||
|
"no-unused-vars": "off",
|
||||||
|
"@typescript-eslint/no-unused-vars": "error"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"ignorePatterns": ["build/", "scripts/build.js"]
|
"ignorePatterns": ["build/", "scripts/build.js"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,22 +35,21 @@ const renderFlowPage = async () => {
|
|||||||
await act(() => {
|
await act(() => {
|
||||||
renderWithRouter(
|
renderWithRouter(
|
||||||
<FlowRecoveryKeyDownload
|
<FlowRecoveryKeyDownload
|
||||||
{...{
|
{...{
|
||||||
localizedBackButtonTitle,
|
localizedBackButtonTitle,
|
||||||
localizedPageTitle,
|
localizedPageTitle,
|
||||||
navigateForward,
|
navigateForward,
|
||||||
navigateBackward,
|
navigateBackward,
|
||||||
viewName,
|
viewName,
|
||||||
}}
|
}}
|
||||||
email={MOCK_EMAIL}
|
email={MOCK_EMAIL}
|
||||||
recoveryKeyValue={MOCK_RECOVERY_KEY_VALUE}
|
recoveryKeyValue={MOCK_RECOVERY_KEY_VALUE}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
describe('FlowRecoveryKeyDownload', () => {
|
describe('FlowRecoveryKeyDownload', () => {
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
jest.clearAllMocks();
|
jest.clearAllMocks();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ describe('Key Stretch Experiment Model', function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const window = new ReachRouterWindow();
|
const window = new ReachRouterWindow();
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
let model: KeyStretchExperiment;
|
let model: KeyStretchExperiment;
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
model = new KeyStretchExperiment(new GenericData({}));
|
model = new KeyStretchExperiment(new GenericData({}));
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import * as LoadingSpinnerModule from 'fxa-react/components/LoadingSpinner';
|
|||||||
|
|
||||||
import { MozServices } from '../lib/types';
|
import { MozServices } from '../lib/types';
|
||||||
import { MOCK_ACCOUNT } from '../models/mocks';
|
import { MOCK_ACCOUNT } from '../models/mocks';
|
||||||
import { Integration, IntegrationType, OAuthNativeIntegration, RelierCmsInfo } from '../models';
|
import { Integration, IntegrationType } from '../models';
|
||||||
|
|
||||||
export const MOCK_EMAIL = MOCK_ACCOUNT.primaryEmail.email;
|
export const MOCK_EMAIL = MOCK_ACCOUNT.primaryEmail.email;
|
||||||
export const MOCK_UID = 'abcd1234abcd1234abcd1234abcd1234';
|
export const MOCK_UID = 'abcd1234abcd1234abcd1234abcd1234';
|
||||||
@@ -103,7 +103,8 @@ export const MOCK_CMS_INFO = {
|
|||||||
logoUrl:
|
logoUrl:
|
||||||
'https://gist.githubusercontent.com/vbudhram/c53b07efd1656acfff7d2c7e9d6825fe/raw/030df98ee27f609333606d36c7bf3af45af53f39/123Done_red.svg',
|
'https://gist.githubusercontent.com/vbudhram/c53b07efd1656acfff7d2c7e9d6825fe/raw/030df98ee27f609333606d36c7bf3af45af53f39/123Done_red.svg',
|
||||||
logoAltText: 'logo',
|
logoAltText: 'logo',
|
||||||
backgroundColor: 'linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 26, 26, 0.25) 40%, rgba(230, 0, 0, 0.3) 70%, rgba(179, 0, 0, 0.45) 100%)',
|
backgroundColor:
|
||||||
|
'linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 26, 26, 0.25) 40%, rgba(230, 0, 0, 0.3) 70%, rgba(179, 0, 0, 0.45) 100%)',
|
||||||
},
|
},
|
||||||
EmailFirstPage: {
|
EmailFirstPage: {
|
||||||
headline: 'Sign up or sign in to your Mozilla account',
|
headline: 'Sign up or sign in to your Mozilla account',
|
||||||
@@ -156,4 +157,4 @@ export const createMockIntegrationWithCms = () =>
|
|||||||
data: {
|
data: {
|
||||||
validate: () => {},
|
validate: () => {},
|
||||||
},
|
},
|
||||||
}) as Integration;
|
}) as Integration;
|
||||||
|
|||||||
Reference in New Issue
Block a user