mirror of
https://github.com/zhigang1992/connect.git
synced 2026-04-29 09:55:41 +08:00
refactor(all): eslint configs, utilise shared package
This commit is contained in:
74
.eslintrc.js
74
.eslintrc.js
@@ -1,73 +1,5 @@
|
||||
module.exports = {
|
||||
extends: [
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
||||
'plugin:react/recommended',
|
||||
'prettier/@typescript-eslint',
|
||||
'plugin:jest/recommended',
|
||||
'plugin:prettier/recommended'
|
||||
// 'plugin:jsx-a11y/recommended'
|
||||
],
|
||||
parser: '@typescript-eslint/parser',
|
||||
parserOptions: {
|
||||
ecmaVersion: '2018',
|
||||
sourceType: 'module',
|
||||
project: './tsconfig.json',
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
plugins: ['@typescript-eslint', 'react', 'jest', 'prettier'],
|
||||
env: {
|
||||
browser: true,
|
||||
node: true,
|
||||
es6: true,
|
||||
'jest/globals': true,
|
||||
},
|
||||
globals: {
|
||||
page: true,
|
||||
browser: true,
|
||||
context: true,
|
||||
jestPuppeteer: true,
|
||||
},
|
||||
rules: {
|
||||
quotes: [2, 'single', { avoidEscape: true }],
|
||||
'eol-last': 2,
|
||||
'no-mixed-requires': 0,
|
||||
'no-var': 2,
|
||||
'no-param-reassign': 'error',
|
||||
'brace-style': 2,
|
||||
'no-empty': 'off',
|
||||
'@typescript-eslint/member-delimiter-style': [
|
||||
'error',
|
||||
{
|
||||
multiline: {
|
||||
delimiter: 'semi',
|
||||
requireLast: true,
|
||||
},
|
||||
singleline: {
|
||||
delimiter: 'semi',
|
||||
requireLast: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
||||
'@typescript-eslint/array-type': 'error',
|
||||
'@typescript-eslint/no-misused-promises': 'error',
|
||||
'@typescript-eslint/no-floating-promises': 'error',
|
||||
'@typescript-eslint/require-await': 'error',
|
||||
'@typescript-eslint/promise-function-async': 'error',
|
||||
'@typescript-eslint/await-thenable': 'error',
|
||||
'@typescript-eslint/no-empty-interface': 'off',
|
||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/no-object-literal-type-assertion': 'off',
|
||||
'@typescript-eslint/explicit-member-accessibility': 'off',
|
||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||
'@typescript-eslint/class-name-casing': 'off',
|
||||
'@typescript-eslint/camelcase': 'off',
|
||||
'@typescript-eslint/no-use-before-define': 'off',
|
||||
'@typescript-eslint/interface-name-prefix': [2],
|
||||
'react/jsx-uses-vars': [2],
|
||||
'react/jsx-key': [0],
|
||||
'react/prop-types': [0],
|
||||
},
|
||||
root: true,
|
||||
reportUnusedDisableDirectives: true,
|
||||
extends: ['@blockstack/eslint-config'],
|
||||
};
|
||||
|
||||
53
package.json
53
package.json
@@ -1,7 +1,33 @@
|
||||
{
|
||||
"name": "root",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"typecheck": "lerna run typecheck --parallel",
|
||||
"dev": "yarn lerna exec --parallel 'yarn dev' --scope test-app --scope @blockstack/app",
|
||||
"bootstrap": "yarn lerna exec --parallel 'yarn'",
|
||||
"build:libs": "yarn build:ui && yarn build:keychain && yarn build:connect",
|
||||
"build:ui": "lerna run build --scope @blockstack/ui",
|
||||
"build:keychain": "lerna run build --scope @blockstack/keychain",
|
||||
"build:connect": "lerna run build --scope @blockstack/connect",
|
||||
"build:app": "lerna run prod:web --scope @blockstack/app",
|
||||
"build:test-app": "lerna run prod:web --scope test-app",
|
||||
"lint": "yarn lint:eslint && yarn lint:prettier",
|
||||
"lint:eslint": "eslint packages/**/*.{ts,tsx}",
|
||||
"lint:fix": "eslint --ext .ts,.tsx . -f unix --fix && prettier --write **/*.{ts,tsx} *.js",
|
||||
"lint:prettier": "prettier --check **/*.{ts,tsx} *.js",
|
||||
"version": "lerna bootstrap"
|
||||
},
|
||||
"prettier": "@blockstack/prettier-config",
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
||||
}
|
||||
},
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@blockstack/eslint-config": "^1.0.3",
|
||||
"@blockstack/prettier-config": "^0.0.6",
|
||||
"@commitlint/cli": "^8.3.5",
|
||||
"@commitlint/config-conventional": "^8.3.4",
|
||||
@@ -21,33 +47,8 @@
|
||||
"eslint-plugin-react-hooks": "^3.0.0",
|
||||
"husky": "^4.2.3",
|
||||
"lerna": "^3.20.2",
|
||||
"prettier": "^2.0.4",
|
||||
"prettier": "^2.0.5",
|
||||
"typescript": "^3.8.2"
|
||||
},
|
||||
"scripts": {
|
||||
"typecheck": "lerna run typecheck --parallel",
|
||||
"dev": "yarn lerna exec --parallel 'yarn dev' --scope test-app --scope @blockstack/app",
|
||||
"bootstrap": "yarn lerna exec --parallel 'yarn'",
|
||||
"build:libs": "yarn build:ui && yarn build:keychain && yarn build:connect",
|
||||
"build:ui": "lerna run build --scope @blockstack/ui",
|
||||
"build:keychain": "lerna run build --scope @blockstack/keychain",
|
||||
"build:connect": "lerna run build --scope @blockstack/connect",
|
||||
"build:app": "lerna run prod:web --scope @blockstack/app",
|
||||
"build:test-app": "lerna run prod:web --scope test-app",
|
||||
"lint": "yarn lint:eslint && yarn lint:prettier",
|
||||
"lint:eslint": "eslint --ext .ts,.tsx . -f unix",
|
||||
"lint:fix": "eslint --ext .ts,.tsx . -f unix --fix && prettier --write **/*.{ts,tsx} *.js",
|
||||
"lint:prettier": "prettier --check **/*.{ts,tsx} *.js",
|
||||
"version": "lerna bootstrap"
|
||||
},
|
||||
"prettier": "@blockstack/prettier-config",
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
||||
}
|
||||
},
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
],
|
||||
"dependencies": {}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,10 @@
|
||||
module.exports = {
|
||||
extends: [
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
||||
'plugin:react/recommended',
|
||||
'prettier/@typescript-eslint',
|
||||
'plugin:jest/recommended',
|
||||
'plugin:prettier/recommended'
|
||||
// 'plugin:jsx-a11y/recommended'
|
||||
],
|
||||
extends: ['@blockstack/eslint-config'],
|
||||
parser: '@typescript-eslint/parser',
|
||||
parserOptions: {
|
||||
ecmaVersion: '2018',
|
||||
sourceType: 'module',
|
||||
project: './tsconfig.json',
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
plugins: ['@typescript-eslint', 'react', 'jest'],
|
||||
plugins: ['jest'],
|
||||
env: {
|
||||
browser: true,
|
||||
node: true,
|
||||
@@ -28,45 +17,6 @@ module.exports = {
|
||||
context: true,
|
||||
},
|
||||
rules: {
|
||||
quotes: [2, 'single', { avoidEscape: true }],
|
||||
'eol-last': 2,
|
||||
'no-mixed-requires': 0,
|
||||
'no-var': 2,
|
||||
'no-param-reassign': 'error',
|
||||
'brace-style': 2,
|
||||
'no-empty': 'off',
|
||||
'@typescript-eslint/member-delimiter-style': [
|
||||
'error',
|
||||
{
|
||||
multiline: {
|
||||
delimiter: 'semi',
|
||||
requireLast: true,
|
||||
},
|
||||
singleline: {
|
||||
delimiter: 'semi',
|
||||
requireLast: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
||||
'@typescript-eslint/array-type': 'error',
|
||||
'@typescript-eslint/no-misused-promises': 'error',
|
||||
'@typescript-eslint/no-floating-promises': 'error',
|
||||
'@typescript-eslint/require-await': 'error',
|
||||
'@typescript-eslint/promise-function-async': 'error',
|
||||
'@typescript-eslint/await-thenable': 'error',
|
||||
'@typescript-eslint/no-empty-interface': 'off',
|
||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/no-object-literal-type-assertion': 'off',
|
||||
'@typescript-eslint/explicit-member-accessibility': 'off',
|
||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||
'@typescript-eslint/class-name-casing': 'off',
|
||||
'@typescript-eslint/camelcase': 'off',
|
||||
'@typescript-eslint/no-use-before-define': 'off',
|
||||
'@typescript-eslint/interface-name-prefix': [2],
|
||||
'react/jsx-uses-vars': [2],
|
||||
'react/jsx-key': [0],
|
||||
'react/prop-types': [0],
|
||||
'@typescript-eslint/no-unnecessary-type-assertion': [0],
|
||||
},
|
||||
};
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
"clean:all": "rm -rf ./dist && rm -rf ./coverage && rm -rf ./node_modules",
|
||||
"dev": "cross-env NODE_ENV=development webpack-dev-server --hot --mode development",
|
||||
"lint": "yarn run lint:eslint && yarn run lint:prettier",
|
||||
"lint:eslint": "eslint --ext .ts,.tsx ./src/ -f unix",
|
||||
"lint:fix": "eslint --ext .ts,.tsx ./src/ -f unix --fix && prettier --write src/**/*.{ts,tsx} *.js",
|
||||
"lint:eslint": "eslint src/**/*.{ts,tsx}",
|
||||
"lint:fix": "eslint --fix src/**/*.{ts,tsx} && prettier --write src/**/*.{ts,tsx} *.js",
|
||||
"lint:prettier": "prettier --check src/**/*.{ts,tsx} *.js",
|
||||
"prod:ext": "cross-env NODE_ENV=production EXT_ENV=prod webpack -p",
|
||||
"prod:web": "cross-env NODE_ENV=production webpack -p",
|
||||
@@ -24,6 +24,7 @@
|
||||
"author": "Blockstack PBC",
|
||||
"dependencies": {
|
||||
"@blockstack/connect": "^2.6.0",
|
||||
"@blockstack/eslint-config": "^1.0.3",
|
||||
"@blockstack/keychain": "^0.3.5",
|
||||
"@blockstack/prettier-config": "^0.0.5",
|
||||
"@blockstack/stats": "^0.7.0",
|
||||
@@ -73,19 +74,13 @@
|
||||
"@types/segment-analytics": "^0.0.32",
|
||||
"@types/styled-components": "5.1.0",
|
||||
"@types/webpack": "^4.41.11",
|
||||
"@typescript-eslint/eslint-plugin": "^2.28.0",
|
||||
"@typescript-eslint/parser": "^2.28.0",
|
||||
"awesome-typescript-loader": "^5.2.1",
|
||||
"babel-loader": "^8.1.0",
|
||||
"bip39": "^3.0.2",
|
||||
"clean-webpack-plugin": "^3.0.0",
|
||||
"copy-webpack-plugin": "^5.0.3",
|
||||
"cross-env": "^7.0.0",
|
||||
"eslint": "^6.7.2",
|
||||
"eslint-config-prettier": "^6.10.1",
|
||||
"eslint-plugin-jest": "^23.7.0",
|
||||
"eslint-plugin-prettier": "^3.1.3",
|
||||
"eslint-plugin-react": "^7.19.0",
|
||||
"eslint-plugin-jest": "^23.11.0",
|
||||
"fork-ts-checker-webpack-plugin": "^4.0.4",
|
||||
"html-webpack-plugin": "^4.0.0-beta.11",
|
||||
"jest": "^25.1.0",
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Flex, Box, FlexProps } from '@blockstack/ui';
|
||||
|
||||
import { ExclamationMark } from './icons/exclamation-mark';
|
||||
|
||||
interface ErrorLabelProps extends FlexProps {}
|
||||
type ErrorLabelProps = FlexProps;
|
||||
|
||||
export const ErrorLabel: React.FC<ErrorLabelProps> = ({ children, ...rest }) => (
|
||||
<Flex mt={3} {...rest}>
|
||||
|
||||
@@ -29,9 +29,9 @@ export const SecretKey: React.FC<SecretKeyProps> = props => {
|
||||
});
|
||||
|
||||
const handleButtonClick = () => {
|
||||
const input: HTMLInputElement = document.querySelector('.hidden-secret-key') as HTMLInputElement;
|
||||
input.select();
|
||||
input.setSelectionRange(0, 99999);
|
||||
const input: HTMLInputElement | null = document.querySelector('.hidden-secret-key');
|
||||
input?.select();
|
||||
input?.setSelectionRange(0, 99999);
|
||||
document.execCommand('copy');
|
||||
setCopiedState(true);
|
||||
document.getSelection()?.empty();
|
||||
|
||||
@@ -33,9 +33,7 @@ const errorTextMap = {
|
||||
[IdentityNameValidityError.UNAVAILABLE]: identityNameUnavailableError,
|
||||
};
|
||||
|
||||
interface UsernameProps {}
|
||||
|
||||
export const Username: React.FC<UsernameProps> = () => {
|
||||
export const Username: React.FC<{}> = () => {
|
||||
const { pathname } = useLocation();
|
||||
|
||||
const { wallet } = useWallet();
|
||||
|
||||
@@ -1,68 +1,13 @@
|
||||
module.exports = {
|
||||
ignorePatterns: ['test-app/', 'node_modules/'],
|
||||
extends: [
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
||||
'plugin:prettier/recommended',
|
||||
'plugin:react/recommended',
|
||||
'prettier/@typescript-eslint',
|
||||
// 'plugin:jsx-a11y/recommended'
|
||||
],
|
||||
extends: ['@blockstack/eslint-config'],
|
||||
parser: '@typescript-eslint/parser',
|
||||
ignorePatterns: ['test-app/', 'node_modules/'],
|
||||
parserOptions: {
|
||||
ecmaVersion: '2018',
|
||||
sourceType: 'module',
|
||||
project: './tsconfig.json',
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
plugins: ['@typescript-eslint', 'react'],
|
||||
env: {
|
||||
browser: true,
|
||||
node: true,
|
||||
es6: true,
|
||||
},
|
||||
rules: {
|
||||
quotes: [2, 'single', { avoidEscape: true }],
|
||||
'eol-last': 2,
|
||||
'no-mixed-requires': 0,
|
||||
'no-var': 2,
|
||||
'no-param-reassign': 'error',
|
||||
'brace-style': 2,
|
||||
'no-empty': 'off',
|
||||
'@typescript-eslint/member-delimiter-style': [
|
||||
'error',
|
||||
{
|
||||
multiline: {
|
||||
delimiter: 'semi',
|
||||
requireLast: true,
|
||||
},
|
||||
singleline: {
|
||||
delimiter: 'semi',
|
||||
requireLast: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
||||
'@typescript-eslint/array-type': 'error',
|
||||
// '@typescript-eslint/semi': ['error', 'never'],
|
||||
'@typescript-eslint/no-misused-promises': 'error',
|
||||
'@typescript-eslint/no-floating-promises': 'error',
|
||||
'@typescript-eslint/require-await': 'error',
|
||||
'@typescript-eslint/promise-function-async': 'error',
|
||||
'@typescript-eslint/await-thenable': 'error',
|
||||
'@typescript-eslint/no-empty-interface': 'off',
|
||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/no-object-literal-type-assertion': 'off',
|
||||
'@typescript-eslint/explicit-member-accessibility': 'off',
|
||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||
'@typescript-eslint/class-name-casing': 'off',
|
||||
'@typescript-eslint/camelcase': 'off',
|
||||
'@typescript-eslint/no-use-before-define': 'off',
|
||||
'@typescript-eslint/interface-name-prefix': 'off',
|
||||
'react/jsx-uses-vars': [2],
|
||||
'react/jsx-key': [0],
|
||||
'react/prop-types': [0],
|
||||
'react/display-name': [0],
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,6 +1,26 @@
|
||||
{
|
||||
"name": "@blockstack/connect",
|
||||
"version": "2.6.0",
|
||||
"scripts": {
|
||||
"build": "yarn build:modules && yarn build:standalone",
|
||||
"build:modules": "tsdx build --format cjs,esm,umd",
|
||||
"build:standalone": "NODE_ENV=production webpack --mode=production",
|
||||
"build:standalone:analyze": "NODE_ENV=production ANALYZE=true webpack --mode=production",
|
||||
"dev": "cd ../test-app && yarn start",
|
||||
"lint": "eslint src/**/*.{ts,tsx}",
|
||||
"lint:fix": "eslint src/**/*.{ts,tsx} --fix",
|
||||
"prepublishOnly": "yarn build",
|
||||
"start": "tsdx watch",
|
||||
"test": "tsdx test",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"prettier": "@blockstack/prettier-config",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"typings": "dist/connect/src/index.d.ts",
|
||||
"unpkg": "dist/bundle.js",
|
||||
"bundlesize": [
|
||||
{
|
||||
"path": "./dist/**/*.js",
|
||||
@@ -19,6 +39,7 @@
|
||||
"@babel/plugin-proposal-optional-chaining": "^7.9.0",
|
||||
"@babel/preset-react": "^7.9.4",
|
||||
"@babel/preset-typescript": "^7.9.0",
|
||||
"@blockstack/eslint-config": "^1.0.3",
|
||||
"@blockstack/prettier-config": "^0.0.6",
|
||||
"@types/jest": "^25.2.1",
|
||||
"@types/react-dom": "^16.9.6",
|
||||
@@ -28,13 +49,6 @@
|
||||
"babel-loader": "^8.1.0",
|
||||
"blockstack": "^19.3.0",
|
||||
"bundlesize": "^0.18.0",
|
||||
"eslint": "^6.8.0",
|
||||
"eslint-config-prettier": "^6.10.1",
|
||||
"eslint-plugin-flowtype": "^4.7.0",
|
||||
"eslint-plugin-import": "^2.20.2",
|
||||
"eslint-plugin-jsx-a11y": "^6.2.3",
|
||||
"eslint-plugin-prettier": "^3.1.3",
|
||||
"eslint-plugin-react": "^7.18.0",
|
||||
"husky": "^4.2.1",
|
||||
"prettier": "^2.0.4",
|
||||
"react": "^16.13.1",
|
||||
@@ -62,25 +76,5 @@
|
||||
"styled-components": "^5.1.0",
|
||||
"use-events": "^1.4.1",
|
||||
"use-onclickoutside": "^0.3.1"
|
||||
},
|
||||
"prettier": "@blockstack/prettier-config",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "yarn build:modules && yarn build:standalone",
|
||||
"build:modules": "tsdx build --format cjs,esm,umd",
|
||||
"build:standalone": "NODE_ENV=production webpack --mode=production",
|
||||
"build:standalone:analyze": "NODE_ENV=production ANALYZE=true webpack --mode=production",
|
||||
"dev": "cd ../test-app && yarn start",
|
||||
"lint": "eslint --ext .ts,.tsx ./src/ -f unix",
|
||||
"lint:fix": "eslint --ext .ts,.tsx ./src/ -f unix --fix",
|
||||
"prepublishOnly": "yarn build",
|
||||
"start": "tsdx watch",
|
||||
"test": "tsdx test",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"typings": "dist/connect/src/index.d.ts",
|
||||
"unpkg": "dist/bundle.js"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import React from 'react';
|
||||
import { Flex, BoxProps } from '@blockstack/ui';
|
||||
import { PX } from '../../common';
|
||||
|
||||
interface ScreenFooterProps extends BoxProps {}
|
||||
type ScreenFooterProps = BoxProps;
|
||||
|
||||
export const ScreenFooter: React.FC<ScreenFooterProps> = ({ children, ...rest }) => (
|
||||
<Flex
|
||||
|
||||
19
packages/keychain/.eslintrc.js
Normal file
19
packages/keychain/.eslintrc.js
Normal file
@@ -0,0 +1,19 @@
|
||||
module.exports = {
|
||||
extends: ['@blockstack/eslint-config'],
|
||||
parser: '@typescript-eslint/parser',
|
||||
parserOptions: {
|
||||
project: './tsconfig.json'
|
||||
},
|
||||
plugins: ['jest'],
|
||||
env: {
|
||||
browser: true,
|
||||
node: true,
|
||||
es6: true,
|
||||
'jest/globals': true,
|
||||
},
|
||||
globals: {
|
||||
page: true,
|
||||
browser: true,
|
||||
context: true,
|
||||
}
|
||||
};
|
||||
@@ -18,8 +18,8 @@
|
||||
"build:esm:watch": "tsc --outDir ./lib-esm -m es6 -t es2017 --watch",
|
||||
"test": "jest",
|
||||
"test:watch": "jest --watch --coverage=false",
|
||||
"lint": "eslint --ext .ts ./src ./tests -f unix",
|
||||
"lint:fix": "eslint --fix --ext .ts ./src ./tests -f unix",
|
||||
"lint": "eslint src/**/*.ts",
|
||||
"lint:fix": "eslint --fix src/**/*.ts",
|
||||
"depcheck": "depcheck --ignores='@types/*,eslint*,safe-buffer,codecov,@typescript-eslint/*,@blockstack/*'",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"prepublishOnly": "yarn build"
|
||||
|
||||
@@ -1,21 +1,10 @@
|
||||
module.exports = {
|
||||
extends: [
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
||||
'plugin:react/recommended',
|
||||
'prettier/@typescript-eslint',
|
||||
'plugin:jest/recommended',
|
||||
'plugin:prettier/recommended'
|
||||
// 'plugin:jsx-a11y/recommended'
|
||||
],
|
||||
extends: ['@blockstack/eslint-config'],
|
||||
parser: '@typescript-eslint/parser',
|
||||
parserOptions: {
|
||||
ecmaVersion: '2018',
|
||||
sourceType: 'module',
|
||||
project: './tsconfig.json',
|
||||
tsconfigRootDir: __dirname,
|
||||
project: './tsconfig.json'
|
||||
},
|
||||
plugins: ['@typescript-eslint', 'react', 'jest'],
|
||||
plugins: ['jest'],
|
||||
env: {
|
||||
browser: true,
|
||||
node: true,
|
||||
@@ -27,46 +16,4 @@ module.exports = {
|
||||
browser: true,
|
||||
context: true,
|
||||
},
|
||||
rules: {
|
||||
quotes: [2, 'single', { avoidEscape: true }],
|
||||
'eol-last': 2,
|
||||
'no-mixed-requires': 0,
|
||||
'no-var': 2,
|
||||
'no-param-reassign': 'error',
|
||||
'brace-style': 2,
|
||||
'no-empty': 'off',
|
||||
'@typescript-eslint/member-delimiter-style': [
|
||||
'error',
|
||||
{
|
||||
multiline: {
|
||||
delimiter: 'semi',
|
||||
requireLast: true,
|
||||
},
|
||||
singleline: {
|
||||
delimiter: 'semi',
|
||||
requireLast: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
||||
'@typescript-eslint/array-type': 'error',
|
||||
'@typescript-eslint/no-misused-promises': 'error',
|
||||
'@typescript-eslint/no-floating-promises': 'error',
|
||||
'@typescript-eslint/require-await': 'error',
|
||||
'@typescript-eslint/promise-function-async': 'error',
|
||||
'@typescript-eslint/await-thenable': 'error',
|
||||
'@typescript-eslint/no-empty-interface': 'off',
|
||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/no-object-literal-type-assertion': 'off',
|
||||
'@typescript-eslint/explicit-member-accessibility': 'off',
|
||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||
'@typescript-eslint/class-name-casing': 'off',
|
||||
'@typescript-eslint/camelcase': 'off',
|
||||
'@typescript-eslint/no-use-before-define': 'off',
|
||||
'@typescript-eslint/interface-name-prefix': [2],
|
||||
'react/jsx-uses-vars': [2],
|
||||
'react/jsx-key': [0],
|
||||
'react/prop-types': [0],
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,10 +1,21 @@
|
||||
module.exports = {
|
||||
ignorePatterns: ['node_modules/'],
|
||||
extends: ['@blockstack/eslint-config'],
|
||||
parser: '@typescript-eslint/parser',
|
||||
parserOptions: {
|
||||
ecmaVersion: '2018',
|
||||
sourceType: 'module',
|
||||
project: './tsconfig.json',
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
plugins: ['react'],
|
||||
env: {
|
||||
browser: true,
|
||||
node: true,
|
||||
es6: true,
|
||||
},
|
||||
globals: {
|
||||
page: true,
|
||||
browser: true,
|
||||
context: true,
|
||||
},
|
||||
rules: {
|
||||
'@typescript-eslint/no-unnecessary-type-assertion': [0],
|
||||
},
|
||||
};
|
||||
|
||||
@@ -39,13 +39,10 @@
|
||||
"@babel/preset-env": "7.9.5",
|
||||
"@babel/preset-react": "7.9.4",
|
||||
"@babel/preset-typescript": "^7.9.0",
|
||||
"@blockstack/eslint-config": "^1.0.3",
|
||||
"@blockstack/prettier-config": "^0.0.6",
|
||||
"@types/color": "^3.0.1",
|
||||
"@types/flushable": "^1.0.1",
|
||||
"@types/prismjs": "^1.16.0",
|
||||
"@typescript-eslint/eslint-plugin": "^2.28.0",
|
||||
"@typescript-eslint/parser": "^2.28.0",
|
||||
"babel-plugin-add-react-displayname": "^0.0.5",
|
||||
"babel-plugin-module-resolver": "4.0.0",
|
||||
"babel-plugin-react-remove-properties": "0.3.0",
|
||||
@@ -53,12 +50,6 @@
|
||||
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
|
||||
"bundlesize": "^0.18.0",
|
||||
"cross-env": "7.0.2",
|
||||
"eslint-config-airbnb-base": "^14.1.0",
|
||||
"eslint-config-prettier": "^6.10.1",
|
||||
"eslint-import-resolver-typescript": "^2.0.0",
|
||||
"eslint-plugin-import": "^2.20.2",
|
||||
"eslint-plugin-prettier": "^3.1.3",
|
||||
"eslint-plugin-react": "^7.19.0",
|
||||
"fs-extra": "9.0.0",
|
||||
"glob": "7.1.6",
|
||||
"path": "0.12.7",
|
||||
@@ -85,9 +76,6 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"lint-staged": {
|
||||
"*.js": [
|
||||
"eslint --fix"
|
||||
],
|
||||
"*.ts": [
|
||||
"tslint -c tslint.json"
|
||||
],
|
||||
|
||||
20
yarn.lock
20
yarn.lock
@@ -8023,15 +8023,6 @@ escodegen@^1.11.1, escodegen@^1.9.1:
|
||||
optionalDependencies:
|
||||
source-map "~0.6.1"
|
||||
|
||||
eslint-config-airbnb-base@^14.1.0:
|
||||
version "14.1.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.1.0.tgz#2ba4592dd6843258221d9bff2b6831bd77c874e4"
|
||||
integrity sha512-+XCcfGyCnbzOnktDVhwsCAx+9DmrzEmuwxyHUJpw+kqBVT744OUBrB09khgFKlK1lshVww6qXGsYPZpavoNjJw==
|
||||
dependencies:
|
||||
confusing-browser-globals "^1.0.9"
|
||||
object.assign "^4.1.0"
|
||||
object.entries "^1.1.1"
|
||||
|
||||
eslint-config-prettier@>=6.10, eslint-config-prettier@^6.10.1:
|
||||
version "6.10.1"
|
||||
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.10.1.tgz#129ef9ec575d5ddc0e269667bf09defcd898642a"
|
||||
@@ -8068,7 +8059,7 @@ eslint-import-resolver-node@^0.3.2:
|
||||
debug "^2.6.9"
|
||||
resolve "^1.13.1"
|
||||
|
||||
eslint-import-resolver-typescript@>=1, eslint-import-resolver-typescript@^2.0.0:
|
||||
eslint-import-resolver-typescript@>=1:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-2.0.0.tgz#e95f126cc12d3018b9cc11692b4dbfd3e17d3ea6"
|
||||
integrity sha512-bT5Frpl8UWoHBtY25vKUOMoVIMlJQOMefHLyQ4Tz3MQpIZ2N6yYKEEIHMo38bszBNUuMBW6M3+5JNYxeiGFH4w==
|
||||
@@ -8137,6 +8128,13 @@ eslint-plugin-import@^2.18.2:
|
||||
read-pkg-up "^2.0.0"
|
||||
resolve "^1.12.0"
|
||||
|
||||
eslint-plugin-jest@^23.11.0:
|
||||
version "23.11.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-23.11.0.tgz#6e01d83ea74c1eefd60811655bbc288bd8ab2e7d"
|
||||
integrity sha512-qedvh6mcMgoLFHjITtG40yKOCu5Fa1GMYesDOclU30ZvtVkf+DaH0fnCn1ysOX/QMdk2SGhQvxvYLowcLaM0GA==
|
||||
dependencies:
|
||||
"@typescript-eslint/experimental-utils" "^2.5.0"
|
||||
|
||||
eslint-plugin-jest@^23.7.0, eslint-plugin-jest@^23.8.2:
|
||||
version "23.8.2"
|
||||
resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-23.8.2.tgz#6f28b41c67ef635f803ebd9e168f6b73858eb8d4"
|
||||
@@ -8188,7 +8186,7 @@ eslint-plugin-react-hooks@^3.0.0:
|
||||
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-3.0.0.tgz#9e80c71846eb68dd29c3b21d832728aa66e5bd35"
|
||||
integrity sha512-EjxTHxjLKIBWFgDJdhKKzLh5q+vjTFrqNZX36uIxWS4OfyXe5DawqPj3U5qeJ1ngLwatjzQnmR0Lz0J0YH3kxw==
|
||||
|
||||
eslint-plugin-react@^7.14.3, eslint-plugin-react@^7.18.0, eslint-plugin-react@^7.19.0:
|
||||
eslint-plugin-react@^7.14.3, eslint-plugin-react@^7.19.0:
|
||||
version "7.19.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.19.0.tgz#6d08f9673628aa69c5559d33489e855d83551666"
|
||||
integrity sha512-SPT8j72CGuAP+JFbT0sJHOB80TX/pu44gQ4vXH/cq+hQTiY2PuZ6IHkqXJV6x1b28GDdo1lbInjKUrrdUf0LOQ==
|
||||
|
||||
Reference in New Issue
Block a user