chore: simplify eslint configuration (#44347)
* chore: extend import/recommended * chore: use recommended lint rules * refactor: apply lint rules * chore: drop used config
This commit is contained in:
committed by
GitHub
parent
4a4aa1f2f9
commit
efba2e777d
@@ -202,7 +202,8 @@ const motivationSchemaValidation = languages => {
|
||||
if (
|
||||
!fileJson.motivationalQuotes.every(
|
||||
object =>
|
||||
object.hasOwnProperty('quote') && object.hasOwnProperty('author')
|
||||
Object.prototype.hasOwnProperty.call(object, 'quote') &&
|
||||
Object.prototype.hasOwnProperty.call(object, 'author')
|
||||
)
|
||||
) {
|
||||
console.warn(`${language}/motivation.json has malformed quote objects.`);
|
||||
|
@@ -31,7 +31,6 @@ function createChallengeNode(challenge, reporter) {
|
||||
type: challenge.challengeType === 7 ? 'CertificateNode' : 'ChallengeNode'
|
||||
};
|
||||
|
||||
/* eslint-disable prefer-object-spread/prefer-object-spread */
|
||||
return JSON.parse(
|
||||
JSON.stringify(
|
||||
Object.assign(
|
||||
|
@@ -29,7 +29,7 @@ exports.sourceNodes = function sourceChallengesSourceNodes(
|
||||
}
|
||||
const { createNode } = actions;
|
||||
const watcher = chokidar.watch(curriculumPath, {
|
||||
ignored: /(^|[\/\\])\../,
|
||||
ignored: /(^|[/\\])\../,
|
||||
ignoreInitial: true,
|
||||
persistent: true,
|
||||
usePolling: true,
|
||||
|
@@ -62,7 +62,7 @@ async function initTestFrame(e: InitTestFrameArg = { code: {} }) {
|
||||
Object.freeze(o);
|
||||
Object.getOwnPropertyNames(o).forEach(function (prop) {
|
||||
if (
|
||||
o.hasOwnProperty(prop) &&
|
||||
Object.prototype.hasOwnProperty.call(o, prop) &&
|
||||
o[prop] !== null &&
|
||||
(typeof o[prop] === 'object' || typeof o[prop] === 'function') &&
|
||||
!Object.isFrozen(o[prop])
|
||||
|
@@ -2,10 +2,7 @@ import React from 'react';
|
||||
|
||||
import styles from './skeleton-styles';
|
||||
|
||||
// TODO: unsure about parameter typing
|
||||
function SkeletonSprite({}: React.FC<
|
||||
React.ComponentPropsWithoutRef<'svg'>
|
||||
>): JSX.Element {
|
||||
function SkeletonSprite(): JSX.Element {
|
||||
return (
|
||||
<div className='sprite-container'>
|
||||
<style dangerouslySetInnerHTML={{ __html: styles }} />
|
||||
|
@@ -109,7 +109,7 @@ function InstantSearchRoot({
|
||||
if (
|
||||
location.state &&
|
||||
typeof location.state === 'object' &&
|
||||
location.state.hasOwnProperty('query')
|
||||
Object.prototype.hasOwnProperty.call(location.state, 'query')
|
||||
) {
|
||||
updateSearchQuery(location.state.query);
|
||||
} else if (location.search) {
|
||||
|
@@ -92,7 +92,7 @@ const buildFunctions = {
|
||||
|
||||
export function canBuildChallenge(challengeData) {
|
||||
const { challengeType } = challengeData;
|
||||
return buildFunctions.hasOwnProperty(challengeType);
|
||||
return Object.prototype.hasOwnProperty.call(buildFunctions, challengeType);
|
||||
}
|
||||
|
||||
export async function buildChallenge(challengeData, options) {
|
||||
|
@@ -122,7 +122,10 @@ const SuperBlockIntroductionPage = (props: SuperBlockProp) => {
|
||||
if (
|
||||
location.state &&
|
||||
typeof location.state === 'object' &&
|
||||
location.state.hasOwnProperty('breadcrumbBlockClick')
|
||||
Object.prototype.hasOwnProperty.call(
|
||||
location.state,
|
||||
'breadcrumbBlockClick'
|
||||
)
|
||||
) {
|
||||
return location.state.breadcrumbBlockClick;
|
||||
}
|
||||
|
Reference in New Issue
Block a user