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"
|
||||
],
|
||||
"*.{ts,tsx}": [
|
||||
"prettier --config _dev/.prettierrc --write"
|
||||
],
|
||||
"packages/fxa-auth-server/**/*.{ts,tsx}": [
|
||||
"prettier --config _dev/.prettierrc --write",
|
||||
"eslint"
|
||||
],
|
||||
"*.css": [
|
||||
|
||||
@@ -1 +1,7 @@
|
||||
storybook-static
|
||||
.storybook/*.js
|
||||
config/
|
||||
public/
|
||||
scripts/
|
||||
*.config.js
|
||||
Gruntfile.js
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
{
|
||||
"root": true,
|
||||
"extends": [
|
||||
"react-app",
|
||||
"react-app/jest"
|
||||
],
|
||||
"extends": ["react-app", "react-app/jest"],
|
||||
"rules": {
|
||||
"import/export": "error",
|
||||
"import/named": "off",
|
||||
@@ -23,5 +20,14 @@
|
||||
"testing-library/no-unnecessary-act": "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"]
|
||||
}
|
||||
|
||||
@@ -35,22 +35,21 @@ const renderFlowPage = async () => {
|
||||
await act(() => {
|
||||
renderWithRouter(
|
||||
<FlowRecoveryKeyDownload
|
||||
{...{
|
||||
localizedBackButtonTitle,
|
||||
localizedPageTitle,
|
||||
navigateForward,
|
||||
navigateBackward,
|
||||
viewName,
|
||||
}}
|
||||
email={MOCK_EMAIL}
|
||||
recoveryKeyValue={MOCK_RECOVERY_KEY_VALUE}
|
||||
{...{
|
||||
localizedBackButtonTitle,
|
||||
localizedPageTitle,
|
||||
navigateForward,
|
||||
navigateBackward,
|
||||
viewName,
|
||||
}}
|
||||
email={MOCK_EMAIL}
|
||||
recoveryKeyValue={MOCK_RECOVERY_KEY_VALUE}
|
||||
/>
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
describe('FlowRecoveryKeyDownload', () => {
|
||||
|
||||
afterEach(() => {
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
@@ -20,6 +20,7 @@ describe('Key Stretch Experiment Model', function () {
|
||||
};
|
||||
|
||||
const window = new ReachRouterWindow();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
let model: KeyStretchExperiment;
|
||||
beforeEach(function () {
|
||||
model = new KeyStretchExperiment(new GenericData({}));
|
||||
|
||||
@@ -6,7 +6,7 @@ import * as LoadingSpinnerModule from 'fxa-react/components/LoadingSpinner';
|
||||
|
||||
import { MozServices } from '../lib/types';
|
||||
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_UID = 'abcd1234abcd1234abcd1234abcd1234';
|
||||
@@ -103,7 +103,8 @@ export const MOCK_CMS_INFO = {
|
||||
logoUrl:
|
||||
'https://gist.githubusercontent.com/vbudhram/c53b07efd1656acfff7d2c7e9d6825fe/raw/030df98ee27f609333606d36c7bf3af45af53f39/123Done_red.svg',
|
||||
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: {
|
||||
headline: 'Sign up or sign in to your Mozilla account',
|
||||
@@ -156,4 +157,4 @@ export const createMockIntegrationWithCms = () =>
|
||||
data: {
|
||||
validate: () => {},
|
||||
},
|
||||
}) as Integration;
|
||||
}) as Integration;
|
||||
|
||||
Reference in New Issue
Block a user