Skip to content

Commit

Permalink
refactor: disable naming-convenction rule (freeCodeCamp#51685)
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammed Mustafa authored Sep 30, 2023
1 parent bbe1f46 commit 49b728d
Show file tree
Hide file tree
Showing 19 changed files with 4 additions and 79 deletions.
55 changes: 1 addition & 54 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,60 +86,7 @@
"rules": {
"import/no-unresolved": "off",
"import/named": 0,
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "default",
"format": ["camelCase"],
"leadingUnderscore": "allow",
"trailingUnderscore": "allow"
},
{
"selector": [
"classProperty",
"objectLiteralProperty",
"typeProperty",
"classMethod",
"objectLiteralMethod",
"typeMethod",
"accessor",
"enumMember"
],
"format": null,
"modifiers": ["requiresQuotes"]
},
{
"selector": "variable",
"format": ["camelCase", "UPPER_CASE", "PascalCase"],
"leadingUnderscore": "allowSingleOrDouble",
"trailingUnderscore": "allow"
},
{
"selector": "typeLike",
"format": ["PascalCase"],
"custom": {
"regex": "^I[A-Z]|[a-zA-Z]Type$",
"match": false
}
},
{
"selector": "typeProperty",
"format": ["camelCase", "PascalCase"]
},
{
"selector": "objectLiteralProperty",
"format": ["camelCase", "PascalCase"],
"leadingUnderscore": "allowSingleOrDouble"
},
{
"selector": "function",
"format": ["camelCase", "PascalCase"]
},
{
"selector": "enumMember",
"format": ["PascalCase"]
}
]
"@typescript-eslint/naming-convention": "off"
}
},
{
Expand Down
2 changes: 0 additions & 2 deletions api/jest.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ type Options = {
sendCSRFToken: boolean;
};

/* eslint-disable @typescript-eslint/naming-convention */
const requests = {
GET: (resource: string) => request(fastifyTestInstance?.server).get(resource),
POST: (resource: string) =>
Expand All @@ -23,7 +22,6 @@ const requests = {
DELETE: (resource: string) =>
request(fastifyTestInstance?.server).delete(resource)
};
/* eslint-enable @typescript-eslint/naming-convention */

export const getCsrfToken = (setCookies: string[]): string | undefined => {
const csrfSetCookie = setCookies.find(str => str.includes('csrf_token'));
Expand Down
1 change: 0 additions & 1 deletion api/src/routes/challenge.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import { omit } from 'lodash';
Expand Down
1 change: 0 additions & 1 deletion api/src/server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ jest.mock('./utils/env', () => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return {
...jest.requireActual('./utils/env'),
// eslint-disable-next-line @typescript-eslint/naming-convention
COOKIE_DOMAIN: '.freecodecamp.org'
};
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { scriptLoader, scriptRemover } from '../../utils/script-loaders';

import type { DonationApprovalData } from './types';

/* eslint-disable @typescript-eslint/naming-convention */
type PayPalButtonScriptLoaderProps = {
isMinimalForm: boolean | undefined;
clientId: string;
Expand Down Expand Up @@ -44,7 +43,6 @@ type PayPalButtonScriptLoaderProps = {
};
planId: string | null;
};
/* eslint-enable @typescript-eslint/naming-convention */

type PayPalButtonScriptLoaderState = {
isSdkLoaded: boolean;
Expand Down
2 changes: 0 additions & 2 deletions client/src/components/Donation/paypal-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ class PaypalButton extends Component<PaypalButtonProps, PaypalButtonState> {

return (
<div className={'paypal-buttons-container'}>
{/* eslint-disable @typescript-eslint/naming-convention */}
<PayPalButtonScriptLoader
clientId={paypalClientId}
createOrder={(
Expand Down Expand Up @@ -170,7 +169,6 @@ class PaypalButton extends Component<PaypalButtonProps, PaypalButtonState> {
color: buttonColor
}}
/>
{/* eslint-enable @typescript-eslint/naming-convention */}
</div>
);
}
Expand Down
1 change: 0 additions & 1 deletion client/src/components/Donation/stripe-card-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ const StripeCardForm = ({
) => {
if (stripe) {
return stripe.confirmCardPayment(clientSecret, {
// eslint-disable-next-line @typescript-eslint/naming-convention
payment_method: paymentMethod
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */
import React, { ReactNode, useEffect } from 'react';

import { useFeature } from '@growthbook/growthbook-react';
Expand Down
1 change: 0 additions & 1 deletion client/src/components/growth-book/growth-book-wrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */
import React, { ReactNode, useEffect } from 'react';
import sha1 from 'sha-1';
import {
Expand Down
1 change: 0 additions & 1 deletion client/src/components/helpers/avatar-renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ function AvatarRenderer({
if (
// we probably have loads of records in the database with this default avatar URL set. To prevent making a request to the image we know will 404.
!/freecodecamp\.com\/sample-image/.test(picture) &&
// eslint-disable-next-line @typescript-eslint/naming-convention
isURL(picture, { require_protocol: true })
) {
validationImage.src = picture;
Expand Down
1 change: 0 additions & 1 deletion client/src/components/settings/about.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ class AboutSettings extends Component<AboutProps, AboutState> {

handlePictureChange = (e: React.FormEvent<HTMLInputElement>) => {
const value = (e.target as HTMLInputElement).value.slice(0);
// eslint-disable-next-line @typescript-eslint/naming-convention
if (isURL(value, { require_protocol: true })) {
this.validationImage.src = encodeURI(value);
} else {
Expand Down
1 change: 0 additions & 1 deletion client/src/components/settings/portfolio.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */
import {
Button,
FormGroup,
Expand Down
1 change: 0 additions & 1 deletion client/src/declarations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ declare module 'sha-1' {
// eslint-disable-next-line no-var
declare var MathJax: {
Hub: {
/* eslint-disable @typescript-eslint/naming-convention*/
Config: (attributes: {
tex2jax: {
inlineMath: Array<string[]>;
Expand Down
1 change: 0 additions & 1 deletion client/src/templates/Challenges/utils/frame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export interface Source {

export interface Context {
window?: Window &
// eslint-disable-next-line @typescript-eslint/naming-convention
typeof globalThis & { i18nContent?: i18n; __pyodide: unknown };
document?: FrameDocument | PythonDocument;
element: HTMLIFrameElement;
Expand Down
1 change: 0 additions & 1 deletion client/src/utils/solution-display-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { CompletedChallenge } from '../redux/prop-types';
import { challengeTypes } from '../../../shared/config/challenge-types';
import { maybeUrlRE } from '.';

// eslint-disable-next-line @typescript-eslint/naming-convention
type DisplayType =
| 'none'
| 'showMultifileProjectSolution'
Expand Down
7 changes: 3 additions & 4 deletions client/utils/gatsby/layout-selector.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ function getComponentNameAndProps(
pathname: string,
pageContext?: { challengeMeta?: { block?: string; superBlock?: string } }
): NameAndProps {
// eslint-disable-next-line testing-library/render-result-naming-convention
const shallow = ShallowRenderer.createRenderer();
const utils = ShallowRenderer.createRenderer();
const LayoutReactComponent = layoutSelector({
element: { type: elementType, props: {}, key: '' },
props: {
Expand All @@ -38,8 +37,8 @@ function getComponentNameAndProps(
pageContext
}
});
shallow.render(<Provider store={store}>{LayoutReactComponent}</Provider>);
const view = shallow.getRenderOutput();
utils.render(<Provider store={store}>{LayoutReactComponent}</Provider>);
const view = utils.getRenderOutput();
return {
props: view.props.children.props as Record<string, unknown>,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
Expand Down
2 changes: 0 additions & 2 deletions tools/client-plugins/browser-scripts/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */

import { PyodideInterface } from 'pyodide';

export interface FrameDocument extends Document {
Expand Down
1 change: 0 additions & 1 deletion tools/client-plugins/browser-scripts/python-runner.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/naming-convention */
// We have to specify pyodide.js because we need to import that file (not .mjs)
// and 'import' defaults to .mjs
import { loadPyodide, type PyodideInterface } from 'pyodide/pyodide.js';
Expand Down
1 change: 0 additions & 1 deletion tools/ui-components/src/drop-down/drop-down.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ type DropdownMenuProps = Props<
MenuRenderPropArg,
never,
{
// eslint-disable-next-line @typescript-eslint/naming-convention
__demoMode?: boolean;
}
>;
Expand Down

0 comments on commit 49b728d

Please sign in to comment.