mirror of
https://github.com/kremalicious/blog.git
synced 2025-01-05 03:15:07 +01:00
dev tweaks
This commit is contained in:
parent
01bcb6d6a3
commit
dd7c294185
@ -15,10 +15,10 @@
|
|||||||
"plugin:@typescript-eslint/recommended",
|
"plugin:@typescript-eslint/recommended",
|
||||||
"plugin:jsx-a11y/recommended",
|
"plugin:jsx-a11y/recommended",
|
||||||
"prettier/@typescript-eslint",
|
"prettier/@typescript-eslint",
|
||||||
|
"prettier/react",
|
||||||
"plugin:prettier/recommended",
|
"plugin:prettier/recommended",
|
||||||
"plugin:react/recommended"
|
"plugin:react/recommended"
|
||||||
],
|
],
|
||||||
"plugins": ["@typescript-eslint", "react", "graphql", "jsx-a11y"],
|
|
||||||
"rules": {
|
"rules": {
|
||||||
"object-curly-spacing": ["error", "always"],
|
"object-curly-spacing": ["error", "always"],
|
||||||
"react/prop-types": "off",
|
"react/prop-types": "off",
|
||||||
@ -26,9 +26,11 @@
|
|||||||
"@typescript-eslint/no-explicit-any": "off"
|
"@typescript-eslint/no-explicit-any": "off"
|
||||||
},
|
},
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"ecmaFeatures": { "jsx": true },
|
|
||||||
"ecmaVersion": 2018,
|
"ecmaVersion": 2018,
|
||||||
"sourceType": "module",
|
"sourceType": "module",
|
||||||
|
"ecmaFeatures": {
|
||||||
|
"jsx": true
|
||||||
|
},
|
||||||
"project": "./tsconfig.json"
|
"project": "./tsconfig.json"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,18 +12,20 @@
|
|||||||
"ssr": "npm run build && serve -s public/",
|
"ssr": "npm run build && serve -s public/",
|
||||||
"test": "npm run lint && jest --coverage",
|
"test": "npm run lint && jest --coverage",
|
||||||
"test:watch": "npm run lint && jest --coverage --watch",
|
"test:watch": "npm run lint && jest --coverage --watch",
|
||||||
"rename:scrypt": "sed -i -e 's|./build/Release/scrypt|scrypt|g' node_modules/scrypt/index.js",
|
|
||||||
"copy": "cp -R content/media/ public",
|
"copy": "cp -R content/media/ public",
|
||||||
"lint": "run-p --continue-on-error lint:js lint:css lint:md",
|
"lint": "run-p --continue-on-error lint:js lint:css lint:md",
|
||||||
"lint:js": "eslint --ignore-path .gitignore --ext .js,.jsx,.ts,.tsx .",
|
"lint:js": "eslint --ignore-path .gitignore --ext .js,.jsx,.ts,.tsx .",
|
||||||
"lint:css": "stylelint 'src/**/*.{css,scss}'",
|
"lint:css": "stylelint 'src/**/*.{css,scss}'",
|
||||||
"lint:md": "markdownlint './**/*.{md,markdown}' --ignore './{node_modules,public,.cache,.git,coverage}/**/*'",
|
"lint:md": "markdownlint './**/*.{md,markdown}' --ignore './{node_modules,public,.cache,.git,coverage}/**/*'",
|
||||||
"format": "npm run lint:js -- --fix && npm run lint:css -- --fix",
|
"format": "prettier --write 'src/**/*.{js,jsx,ts,tsx,md,json,css,scss}'",
|
||||||
"deploy": "./scripts/deploy.sh",
|
"deploy": "./scripts/deploy.sh",
|
||||||
"new": "babel-node ./scripts/new.js"
|
"new": "babel-node ./scripts/new.js"
|
||||||
},
|
},
|
||||||
"browserslist": [
|
"browserslist": [
|
||||||
"last 2 versions"
|
">0.2%",
|
||||||
|
"not dead",
|
||||||
|
"not ie <= 11",
|
||||||
|
"not op_mini all"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"dms2dec": "^1.1.0",
|
"dms2dec": "^1.1.0",
|
||||||
|
13
src/@types/declarations.d.ts
vendored
13
src/@types/declarations.d.ts
vendored
@ -1,13 +0,0 @@
|
|||||||
declare module '*.scss' {
|
|
||||||
const content: { [className: string]: string }
|
|
||||||
export = content
|
|
||||||
}
|
|
||||||
|
|
||||||
/* eslint-disable-next-line @typescript-eslint/no-empty-interface */
|
|
||||||
interface SvgrComponent
|
|
||||||
extends React.StatelessComponent<React.SVGAttributes<SVGElement>> {}
|
|
||||||
|
|
||||||
declare module '*.svg' {
|
|
||||||
const value: SvgrComponent
|
|
||||||
export default value
|
|
||||||
}
|
|
23
src/@types/global.d.ts
vendored
Normal file
23
src/@types/global.d.ts
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
interface CSSModule {
|
||||||
|
[className: string]: string
|
||||||
|
}
|
||||||
|
|
||||||
|
// type shims for CSS modules
|
||||||
|
declare module '*.module.scss' {
|
||||||
|
const cssModule: CSSModule
|
||||||
|
export = cssModule
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module '*.module.css' {
|
||||||
|
const cssModule: CSSModule
|
||||||
|
export = cssModule
|
||||||
|
}
|
||||||
|
|
||||||
|
/* eslint-disable-next-line @typescript-eslint/no-empty-interface */
|
||||||
|
interface SvgrComponent
|
||||||
|
extends React.StatelessComponent<React.SVGAttributes<SVGElement>> {}
|
||||||
|
|
||||||
|
declare module '*.svg' {
|
||||||
|
const value: SvgrComponent
|
||||||
|
export default value
|
||||||
|
}
|
@ -1,15 +1,17 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "./dist/",
|
|
||||||
"sourceMap": true,
|
|
||||||
"noImplicitAny": true,
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"target": "esnext",
|
"target": "esnext",
|
||||||
|
"jsx": "preserve",
|
||||||
|
"lib": ["dom", "es2015", "es2017"],
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"jsx": "react",
|
"noEmit": true,
|
||||||
"lib": ["dom", "esnext"],
|
"isolatedModules": true,
|
||||||
"noEmit": true
|
"esModuleInterop": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"noUnusedLocals": true,
|
||||||
|
"noUnusedParameters": true,
|
||||||
|
"preserveConstEnums": true
|
||||||
},
|
},
|
||||||
"exclude": ["node_modules", "public", ".cache", "*.js"],
|
"exclude": ["node_modules", "public", ".cache", "*.js"],
|
||||||
"include": ["./src/**/*"]
|
"include": ["./src/**/*"]
|
||||||
|
Loading…
Reference in New Issue
Block a user