Skip to content

Commit

Permalink
ESlint refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
VityaSchel committed Mar 30, 2021
1 parent 1ca4d12 commit eb806c6
Show file tree
Hide file tree
Showing 39 changed files with 382 additions and 383 deletions.
30 changes: 30 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# standart
/node_modules/**
/.next/**
/.git/**
next.config.js
.eslintrc.js

# packages
package-lock.json
yarn.lock
less-watcher.config.json

# markdown files
LICENSE
README.md
CONTRIBUTING.md

# images
*.png
*.jpg
*.jpeg
*.svg
*.ico

# styles
*.css
*.css.map
*.less

*.woff2
84 changes: 48 additions & 36 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,53 @@
module.exports = {
"env": {
"browser": true,
"es2021": true
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended"
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": [
"react",
"@typescript-eslint"
],
"rules": {
"indent": [
"error",
2
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": [
"react",
"@typescript-eslint"
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"double"
],
"semi": [
"error",
"never"
],
"react/prop-types": [
"off",
0
],
"@typescript-eslint/no-explicit-any": [
"off",
0
],
"rules": {
"indent": [
"error",
4
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"double"
],
"semi": [
"error",
"never"
]
}
"@typescript-eslint/explicit-module-boundary-types": [
"off",
0
]
}
}
8 changes: 4 additions & 4 deletions components/Biography/bio-banner.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import Form from '../Common/form'
import Slogan from '../Common/slogan'
import React from "react"
import Form from "../Common/form"
import Slogan from "../Common/slogan"

class LongBioText extends React.Component {
render(){
Expand Down Expand Up @@ -33,7 +33,7 @@ class LongBio extends React.Component {
}

export default class BioBanner extends React.Component {
render(){
render(): void{
return (
<div id="banner" className="family">
<div id="banner--container" className="shrink">
Expand Down
8 changes: 4 additions & 4 deletions components/Biography/public-ribbon.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { Component } from 'react'
import React, { Component } from "react"

interface IPublicEventProps {
year: Number;
title: String;
year: number;
title: string;
}

class PublicEvent extends Component<IPublicEventProps> {
Expand All @@ -17,7 +17,7 @@ class PublicEvent extends Component<IPublicEventProps> {
}

export default class PublicRibbon extends React.Component {
render(){
render(): void {
return (
<div id="public-ribbon">
<div id="ribbon-items">
Expand Down
9 changes: 4 additions & 5 deletions components/Biography/timeline.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React, { Component } from 'react'
import { default as $D } from 'dedent'
import React from "react"

interface IBio {
year: Number;
year: number;
}

class TimelineEvent extends React.Component<IBio> {
Expand All @@ -23,7 +22,7 @@ class TimelineEvent extends React.Component<IBio> {
}

export default class Timeline extends React.Component {
render() {
render(): void {
return (<>
<div id="timeline">
<table id="timeline-table">
Expand All @@ -43,7 +42,7 @@ export default class Timeline extends React.Component {
<TimelineEvent year={1996}>
Абоба идет в музыкальную школу гимназию в Луганске. Позже музыкальное образование
ему понадобится, чтобы создать студию GVS и прославиться стыдным интервью без маски.
Сейчас весь свой талант он спускает на прямых потоках дерьма, делая "гадзы" и реп.
Сейчас весь свой талант он спускает на прямых потоках дерьма, делая &quot;гадзы&quot; и реп.
</TimelineEvent>
<TimelineEvent year={2007}>
Абоба поступает в Восточно-Украинский национальный университет им. Владимира Даля,
Expand Down
6 changes: 3 additions & 3 deletions components/Comments/comments-banner.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import Form from '../Common/form'
import React from "react"
import Form from "../Common/form"

class ContactInfo extends React.Component {
render(){
Expand All @@ -22,7 +22,7 @@ class ContactInfo extends React.Component {
}

export default class PeopleComments extends React.Component {
render(){
render(): void {
return (
<div id="banner" className="europecity">
<div id="banner--container" className="super-shrink">
Expand Down
87 changes: 26 additions & 61 deletions components/Comments/people-comments.tsx
Original file line number Diff line number Diff line change
@@ -1,67 +1,32 @@
import React from 'react'
import Link from 'next/link'
import slidesData from '../../data/comments'

class Person extends React.Component {
render(){
return (
<div className="contact-person">
<img src={this.props.avatar} alt={this.props.alt ?? this.props.name}/>
<div className="person-info">
<h4>{this.props.name}</h4>
<span className="person-note">{this.props.note}</span>
{this.props.children}
</div>
</div>
)
}
}

class ContactPersons extends React.Component {
render(){
return (
<div id="contact-flex">
<div id="contact-left-col">
<h3 className="primary-heading">Контакты пресс-службы</h3>
</div>
<div id="contact-right-col">
<Person name="Абоба" note="Руководитель ФБК (Фонд Борьбы с Кролями)" avatar="/images/aboba-avatar.png">
<a href="mailto:gladikotv@gmail.com" className="pseudo-link">gladikotv@gmail.com</a>
</Person>
<Person name="Затуп Спермакин" alt="Свинья" note="Никогда не отвечает на сообщения" avatar="/images/citinez-avatar.png">
<a href="mailto:menegvalakas@gmail.com" className="pseudo-link">menegvalakas@gmail.com</a>
</Person>
</div>
</div>
)
}
}
import React from "react"
import Link from "next/link"
import slidesData from "../../data/comments"

class CommentText extends React.Component {
render(){
return (
<p>{this.props.children.includes('%link%')?
(
<>
{this.props.children.replace(/%link%/, '')}
<Link href='https://change.org/p/денис-сухачев-спасти-соню-от-живодера-александра-citinez-семакина'>
<a className='pseudo-link' target="_blank">#СОНЯЖИВИ</a>
</Link>
</>
)
<p>{this.props.children.includes("%link%")?
(
<>
{this.props.children.replace(/%link%/, "")}
<Link href='https://change.org/p/денис-сухачев-спасти-соню-от-живодера-александра-citinez-семакина'>
<a className='pseudo-link' target="_blank">#СОНЯЖИВИ</a>
</Link>
</>
)
:
(
this.props.children.includes("@ProbablyKrolBot")?
<>
{this.props.children.replace(/@ProbablyKrolBot/, "")}
<Link href="https://t.me/ProbablyKrolBot">
<a className="pseudo-link" target="_blank">@ProbablyKrolBot</a>
</Link>
</>
:
(
this.props.children.includes('@ProbablyKrolBot')?
<>
{this.props.children.replace(/@ProbablyKrolBot/, '')}
<Link href="https://t.me/ProbablyKrolBot">
<a className="pseudo-link" target="_blank">@ProbablyKrolBot</a>
</Link>
</>
:
this.props.children
)
}</p>
this.props.children
)
}</p>
)
}
}
Expand All @@ -70,7 +35,7 @@ class Comments extends React.Component {
render(){
const comments = slidesData.map(comment => {
return (
<div className="comment-block">
<div className="comment-block" key={comment.id}>
<div className="comment-content">
<img src={comment.avatar} alt="Фотография избирателя" className="comment-avatar"/>
<div className="comment-text">
Expand All @@ -92,7 +57,7 @@ class Comments extends React.Component {
}

export default class PeopleComments extends React.Component {
render(){
render(): void {
return (
<div id="people-comments">
<Comments />
Expand Down
17 changes: 6 additions & 11 deletions components/Common/footer.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import React from 'react'
import Link from 'next/link'
import React from "react"

export default class Footer extends React.Component {
constructor(props){
super(props)
}

render(){
render(): void {
return (
<footer>
<div id="footer-info">
Expand All @@ -15,13 +10,13 @@ export default class Footer extends React.Component {
<a href="mailto:gadza1488@гадзы.online" className="pseudo-link">gadza1488@гадзы.online</a>
</div>
<div id="note">
<p>
<p>
Сайт сделан в память о пожилом воине донбасса Валере, умершем в 2016 году под давлением шкилы,
на замену которому пришел пенчик и бесконечные слеты маски.
</p>
<p>
</p>
<p>
Когда-нибудь саша citinez обязательно скинет деду сайт для заказа рофл-звонков...
</p>
</p>
</div>
</div>
</footer>
Expand Down
14 changes: 7 additions & 7 deletions components/Common/form.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import React from 'react'
import React from "react"

export default class Form extends React.Component {
constructor (props){
super(props);
super(props)

this.mail = React.createRef()
this.submit = React.createRef()
}

handleSubmit(event): void {
event.preventDefault()
this.mail.current.setAttribute('disabled', 'disabled')
this.submit.current.setAttribute('disabled', 'disabled')
this.submit.current.innerText = 'Готово'
this.mail.current.setAttribute("disabled", "disabled")
this.submit.current.setAttribute("disabled", "disabled")
this.submit.current.innerText = "Готово"
}

render(){
render() {
return (
<form onSubmit={e => this.handleSubmit(e)}>
<input type="email" name='email' placeholder="Ваша электронная почта"
required ref={this.mail} autocomplete='on' autocompletetype='email'/>
required ref={this.mail} autoComplete='on' autocompletetype='email'/>
<button type="submit" ref={this.submit} className="glow-button">Зарегистрироваться</button>
</form>
)
Expand Down
2 changes: 1 addition & 1 deletion components/Common/galleryribbon.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import React from "react"

class GalleryPhoho extends React.Component {
render(){
Expand Down
Loading

0 comments on commit eb806c6

Please sign in to comment.