mirror of
https://github.com/koodiklinikka/koodiklinikka.fi.git
synced 2026-02-25 00:56:46 +00:00
Reinstate linting, fix kvetches
This commit is contained in:
33
.eslintrc
33
.eslintrc
@@ -1,8 +1,22 @@
|
||||
{
|
||||
"extends": "airbnb",
|
||||
"ecmaFeatures": {
|
||||
"jsx": true,
|
||||
"modules": true
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:react/recommended",
|
||||
"prettier"
|
||||
],
|
||||
"plugins": [
|
||||
"react"
|
||||
],
|
||||
"parserOptions": {
|
||||
"ecmaFeatures": {
|
||||
"jsx": true,
|
||||
"modules": true
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"react": {
|
||||
"version": "detect"
|
||||
}
|
||||
},
|
||||
"env": {
|
||||
"browser": true,
|
||||
@@ -10,13 +24,11 @@
|
||||
},
|
||||
"parser": "babel-eslint",
|
||||
"rules": {
|
||||
"quotes": [2, "single"],
|
||||
"react/jsx-uses-react": 2,
|
||||
"react/jsx-uses-vars": 2,
|
||||
"react/react-in-jsx-scope": 2,
|
||||
"react/jsx-no-target-blank": 1,
|
||||
"comma-dangle": [2, "never"],
|
||||
"space-after-keywords": [2, "never"],
|
||||
"react/jsx-quotes": [2, "single"],
|
||||
"react/prop-types": 0,
|
||||
"no-use-before-define": 0,
|
||||
"padded-blocks": 0,
|
||||
@@ -24,10 +36,7 @@
|
||||
"min": 3,
|
||||
"max": 30,
|
||||
"properties": "never",
|
||||
"exceptions": ["x", "y", "vx", "vy", "id", "i", "e", "fn"]
|
||||
"exceptions": ["x", "y", "vx", "vy", "id", "i", "e", "fn", "_"]
|
||||
}]
|
||||
},
|
||||
"plugins": [
|
||||
"react"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
import React from "react";
|
||||
|
||||
export default function EmailComponent() {
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
import React from "react";
|
||||
|
||||
function clamp(min, max, value) {
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
import React from "react";
|
||||
import request from "axios";
|
||||
import _ from "lodash";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import React from "react";
|
||||
import EmailComponent from "./EmailComponent";
|
||||
|
||||
export function Footer() {
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
import request from "axios";
|
||||
import React from "react";
|
||||
import classSet from "classnames";
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
import React from "react";
|
||||
import request from "axios";
|
||||
import _ from "lodash";
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
import _ from "lodash";
|
||||
import githubEvent from "parse-github-event";
|
||||
import twitterText from "twitter-text";
|
||||
|
||||
@@ -18,9 +18,10 @@ var fieldNameTranslations = {
|
||||
postcode: { fi: "Postinumero" }
|
||||
};
|
||||
|
||||
const mailValidateRe = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
||||
|
||||
function validateEmail(email) {
|
||||
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
||||
return re.test(email);
|
||||
return mailValidateRe.test(email);
|
||||
}
|
||||
|
||||
const fieldNames = ["name", "email", "handle", "address", "postcode", "city"];
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"build": "rm -rf public && gulp build",
|
||||
"dev": "SERVER=http://localhost:9000/ ENV=development npm start",
|
||||
"prod": "ENV=production npm start",
|
||||
"lint": "eslint src"
|
||||
"lint": "eslint --ext .jsx --ext .js ."
|
||||
},
|
||||
"dependencies": {
|
||||
"@zeit/next-css": "^1.0.1",
|
||||
@@ -34,6 +34,10 @@
|
||||
"twitter-text": "^1.11.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-eslint": "^10.0.3",
|
||||
"eslint": "^6.4.0",
|
||||
"eslint-config-prettier": "^6.3.0",
|
||||
"eslint-plugin-react": "^7.14.3",
|
||||
"prettier": "^1.18.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import React from "react";
|
||||
import Document, { Html, Head, Main, NextScript } from "next/document";
|
||||
import { Footer } from "../components/Footer";
|
||||
import Fader from '../components/Fader';
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import React from "react";
|
||||
import "../styles/style.styl";
|
||||
import "../styles/icons.less";
|
||||
import Head from "next/head";
|
||||
|
||||
Reference in New Issue
Block a user