chore(linting): change arrowParents configuration, upgrade eslint config

This commit is contained in:
Alexander Shelepenok 2022-04-24 16:21:11 +00:00
parent 729d964c9e
commit 427a6f40f3
10 changed files with 20 additions and 23 deletions

View File

@ -1,4 +1,4 @@
{ {
"arrowParens": "avoid", "arrowParens": "always",
"trailingComma": "all" "trailingComma": "all"
} }

View File

@ -39,7 +39,7 @@ const createPages: GatsbyNode["createPages"] = async ({ graphql, actions }) => {
const pages = await queries.pagesQuery(graphql); const pages = await queries.pagesQuery(graphql);
pages.forEach(edge => { pages.forEach((edge) => {
const { node } = edge; const { node } = edge;
if (node?.frontmatter?.template === "page" && node?.fields?.slug) { if (node?.frontmatter?.template === "page" && node?.fields?.slug) {
@ -88,7 +88,7 @@ const createPages: GatsbyNode["createPages"] = async ({ graphql, actions }) => {
const metadata = await queries.metadataQuery(graphql); const metadata = await queries.metadataQuery(graphql);
const postsLimit = metadata?.postsLimit ?? 1; const postsLimit = metadata?.postsLimit ?? 1;
categories.forEach(category => { categories.forEach((category) => {
const total = Math.ceil(category.totalCount / postsLimit); const total = Math.ceil(category.totalCount / postsLimit);
const path = utils.concat( const path = utils.concat(
constants.routes.categoryRoute, constants.routes.categoryRoute,
@ -110,7 +110,7 @@ const createPages: GatsbyNode["createPages"] = async ({ graphql, actions }) => {
const tags = await queries.tagsQuery(graphql); const tags = await queries.tagsQuery(graphql);
tags.forEach(tag => { tags.forEach((tag) => {
const path = utils.concat( const path = utils.concat(
constants.routes.tagRoute, constants.routes.tagRoute,
"/", "/",

View File

@ -30,7 +30,7 @@ const onCreateNode: GatsbyNode["onCreateNode"] = ({
} }
if (tags) { if (tags) {
const value = tags.map(tag => const value = tags.map((tag) =>
utils.concat( utils.concat(
constants.routes.tagRoute, constants.routes.tagRoute,
"/", "/",

21
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "gatsby-starter-lumen", "name": "gatsby-starter-lumen",
"version": "1.1.27", "version": "1.1.28",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "gatsby-starter-lumen", "name": "gatsby-starter-lumen",
"version": "1.1.27", "version": "1.1.28",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@sentry/gatsby": "^6.19.6", "@sentry/gatsby": "^6.19.6",
@ -42,7 +42,7 @@
"react-helmet": "^6.1.0" "react-helmet": "^6.1.0"
}, },
"devDependencies": { "devDependencies": {
"@alxshelepenok/eslint-config": "^1.0.29", "@alxshelepenok/eslint-config": "^1.0.30",
"@commitlint/cli": "^16.2.3", "@commitlint/cli": "^16.2.3",
"@commitlint/config-conventional": "^16.2.1", "@commitlint/config-conventional": "^16.2.1",
"@jest/globals": "^27.5.1", "@jest/globals": "^27.5.1",
@ -106,13 +106,10 @@
} }
}, },
"node_modules/@alxshelepenok/eslint-config": { "node_modules/@alxshelepenok/eslint-config": {
"version": "1.0.29", "version": "1.0.30",
"resolved": "https://registry.npmjs.org/@alxshelepenok/eslint-config/-/eslint-config-1.0.29.tgz", "resolved": "https://registry.npmjs.org/@alxshelepenok/eslint-config/-/eslint-config-1.0.30.tgz",
"integrity": "sha512-IXaoj1MfXh1rzc54dhKKZbM9PfU5CE/7wpzpPPg8iWDoVBjRfUUpNS2KBuxkodLdN6vAYhgvcxdq7f3BiUUu9w==", "integrity": "sha512-X6rIso749dYRzez/3EkXlr7tkTFgFNPrmGqYGEqpOl2WPYbhcOAAg2/Kv8Je1105r3p7rnA8Fg1AqJLPDQkZWQ==",
"dev": true, "dev": true,
"engines": {
"node": ">= 12 || ^10.12"
},
"peerDependencies": { "peerDependencies": {
"eslint": "^7.7.0 || ^8.2.0" "eslint": "^7.7.0 || ^8.2.0"
} }
@ -30068,9 +30065,9 @@
}, },
"dependencies": { "dependencies": {
"@alxshelepenok/eslint-config": { "@alxshelepenok/eslint-config": {
"version": "1.0.29", "version": "1.0.30",
"resolved": "https://registry.npmjs.org/@alxshelepenok/eslint-config/-/eslint-config-1.0.29.tgz", "resolved": "https://registry.npmjs.org/@alxshelepenok/eslint-config/-/eslint-config-1.0.30.tgz",
"integrity": "sha512-IXaoj1MfXh1rzc54dhKKZbM9PfU5CE/7wpzpPPg8iWDoVBjRfUUpNS2KBuxkodLdN6vAYhgvcxdq7f3BiUUu9w==", "integrity": "sha512-X6rIso749dYRzez/3EkXlr7tkTFgFNPrmGqYGEqpOl2WPYbhcOAAg2/Kv8Je1105r3p7rnA8Fg1AqJLPDQkZWQ==",
"dev": true, "dev": true,
"requires": {} "requires": {}
}, },

View File

@ -80,7 +80,7 @@
"react-helmet": "^6.1.0" "react-helmet": "^6.1.0"
}, },
"devDependencies": { "devDependencies": {
"@alxshelepenok/eslint-config": "^1.0.29", "@alxshelepenok/eslint-config": "^1.0.30",
"@commitlint/cli": "^16.2.3", "@commitlint/cli": "^16.2.3",
"@commitlint/config-conventional": "^16.2.1", "@commitlint/config-conventional": "^16.2.1",
"@jest/globals": "^27.5.1", "@jest/globals": "^27.5.1",

View File

@ -12,7 +12,7 @@ type Props = {
const Feed: React.FC<Props> = ({ edges }: Props) => ( const Feed: React.FC<Props> = ({ edges }: Props) => (
<div className={styles.feed}> <div className={styles.feed}>
{edges.map(edge => ( {edges.map((edge) => (
<div className={styles.item} key={edge.node.fields.slug}> <div className={styles.item} key={edge.node.fields.slug}>
<div className={styles.meta}> <div className={styles.meta}>
<time <time

View File

@ -14,7 +14,7 @@ type Props = {
const Contacts: React.FC<Props> = ({ contacts }: Props) => ( const Contacts: React.FC<Props> = ({ contacts }: Props) => (
<div className={styles.contacts}> <div className={styles.contacts}>
<ul className={styles.list}> <ul className={styles.list}>
{(Object.keys(contacts) as Array<keyof typeof ICONS>).map(name => {(Object.keys(contacts) as Array<keyof typeof ICONS>).map((name) =>
contacts[name] ? ( contacts[name] ? (
<li className={styles.item} key={name}> <li className={styles.item} key={name}>
<a <a

View File

@ -14,7 +14,7 @@ type Props = {
const Menu: React.FC<Props> = ({ menu }: Props) => ( const Menu: React.FC<Props> = ({ menu }: Props) => (
<nav className={styles.menu}> <nav className={styles.menu}>
<ul className={styles.list}> <ul className={styles.list}>
{menu.map(item => ( {menu.map((item) => (
<li className={styles.item} key={item.path}> <li className={styles.item} key={item.path}>
<Link <Link
to={item.path} to={item.path}

View File

@ -17,7 +17,7 @@ const CategoriesTemplate: React.FC = () => {
<Sidebar /> <Sidebar />
<Page title="Categories"> <Page title="Categories">
<ul> <ul>
{categories.map(category => ( {categories.map((category) => (
<li key={category.fieldValue}> <li key={category.fieldValue}>
<Link to={`/category/${toKebabCase(category.fieldValue)}/`}> <Link to={`/category/${toKebabCase(category.fieldValue)}/`}>
{category.fieldValue} ({category.totalCount}) {category.fieldValue} ({category.totalCount})

View File

@ -17,7 +17,7 @@ const TagsTemplate: React.FC = () => {
<Sidebar /> <Sidebar />
<Page title="Tags"> <Page title="Tags">
<ul> <ul>
{tags.map(tag => ( {tags.map((tag) => (
<li key={tag.fieldValue}> <li key={tag.fieldValue}>
<Link to={`/tag/${toKebabCase(tag.fieldValue)}/`}> <Link to={`/tag/${toKebabCase(tag.fieldValue)}/`}>
{tag.fieldValue} ({tag.totalCount}) {tag.fieldValue} ({tag.totalCount})