-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use ESLint instead of TSLint * Allow quotes in jsx
- Loading branch information
Showing
201 changed files
with
3,214 additions
and
2,460 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,253 @@ | ||
module.exports = { | ||
settings: { | ||
react: { | ||
version: 'detect', | ||
}, | ||
}, | ||
env: { | ||
browser: true, | ||
es6: true, | ||
}, | ||
extends: [ | ||
'plugin:react/recommended', | ||
'prettier', | ||
'prettier/@typescript-eslint', | ||
], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
project: 'tsconfig.json', | ||
sourceType: 'module', | ||
}, | ||
plugins: [ | ||
'eslint-plugin-import', | ||
'eslint-plugin-react', | ||
'eslint-plugin-prefer-arrow', | ||
'eslint-plugin-jsdoc', | ||
'@typescript-eslint', | ||
'@typescript-eslint/tslint', | ||
], | ||
rules: { | ||
'@typescript-eslint/adjacent-overload-signatures': 'error', | ||
'@typescript-eslint/array-type': [ | ||
'error', | ||
{ | ||
default: 'array-simple', | ||
}, | ||
], | ||
'@typescript-eslint/ban-types': [ | ||
'error', | ||
{ | ||
types: { | ||
Object: { | ||
message: | ||
'Avoid using the `Object` type. Did you mean `object`?', | ||
}, | ||
Function: { | ||
message: | ||
'Avoid using the `Function` type. Prefer a specific function type, like `() => void`.', | ||
}, | ||
Boolean: { | ||
message: | ||
'Avoid using the `Boolean` type. Did you mean `boolean`?', | ||
}, | ||
Number: { | ||
message: | ||
'Avoid using the `Number` type. Did you mean `number`?', | ||
}, | ||
String: { | ||
message: | ||
'Avoid using the `String` type. Did you mean `string`?', | ||
}, | ||
Symbol: { | ||
message: | ||
'Avoid using the `Symbol` type. Did you mean `symbol`?', | ||
}, | ||
}, | ||
}, | ||
], | ||
'@typescript-eslint/consistent-type-assertions': 'error', | ||
'@typescript-eslint/consistent-type-definitions': 'error', | ||
'@typescript-eslint/dot-notation': 'off', | ||
'@typescript-eslint/explicit-member-accessibility': [ | ||
'error', | ||
{ | ||
accessibility: 'explicit', | ||
}, | ||
], | ||
'@typescript-eslint/member-delimiter-style': [ | ||
'off', | ||
{ | ||
multiline: { | ||
delimiter: 'none', | ||
requireLast: true, | ||
}, | ||
singleline: { | ||
delimiter: 'semi', | ||
requireLast: false, | ||
}, | ||
}, | ||
], | ||
'@typescript-eslint/member-ordering': 'error', | ||
'@typescript-eslint/naming-convention': [ | ||
'error', | ||
{ | ||
selector: 'variable', | ||
format: ['camelCase', 'UPPER_CASE', 'PascalCase'], | ||
leadingUnderscore: 'allow', | ||
}, | ||
{ | ||
selector: ['method', 'function'], | ||
format: ['camelCase', 'PascalCase'], | ||
leadingUnderscore: 'allow', | ||
}, | ||
], | ||
'@typescript-eslint/no-empty-function': 'error', | ||
'@typescript-eslint/no-empty-interface': 'error', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-misused-new': 'error', | ||
'@typescript-eslint/no-namespace': 'error', | ||
'@typescript-eslint/no-parameter-properties': 'off', | ||
'@typescript-eslint/no-this-alias': 'error', | ||
'@typescript-eslint/no-unused-expressions': 'error', | ||
'@typescript-eslint/no-use-before-define': 'off', | ||
'@typescript-eslint/no-var-requires': 'off', | ||
'@typescript-eslint/prefer-for-of': 'error', | ||
'@typescript-eslint/prefer-function-type': 'off', | ||
'@typescript-eslint/prefer-namespace-keyword': 'error', | ||
'@typescript-eslint/semi': ['off', null], | ||
'@typescript-eslint/triple-slash-reference': [ | ||
'error', | ||
{ | ||
path: 'always', | ||
types: 'prefer-import', | ||
lib: 'always', | ||
}, | ||
], | ||
'@typescript-eslint/tslint/config': [ | ||
'error', | ||
{ | ||
rules: { | ||
'prefer-conditional-expression': true, | ||
}, | ||
}, | ||
], | ||
'@typescript-eslint/unified-signatures': 'error', | ||
// '@typescript-eslint/no-shadow': ['error'], | ||
'arrow-body-style': 'error', | ||
'arrow-parens': ['off', 'always'], | ||
'brace-style': ['off', 'off'], | ||
complexity: 'off', | ||
'constructor-super': 'error', | ||
curly: 'error', | ||
eqeqeq: ['error', 'smart'], | ||
'guard-for-in': 'error', | ||
'id-blacklist': [ | ||
'error', | ||
'any', | ||
'Number', | ||
'number', | ||
'String', | ||
'string', | ||
'Boolean', | ||
'boolean', | ||
'Undefined', | ||
'undefined', | ||
], | ||
'id-match': 'error', | ||
'import/no-extraneous-dependencies': [ | ||
'error', | ||
{ | ||
devDependencies: false, | ||
}, | ||
], | ||
'import/no-internal-modules': 'off', | ||
'import/order': 'off', | ||
'jsdoc/check-alignment': 'error', | ||
'jsdoc/check-indentation': 'error', | ||
'jsdoc/newline-after-description': 'error', | ||
'max-classes-per-file': 'off', | ||
'no-bitwise': 'error', | ||
'no-caller': 'error', | ||
'no-cond-assign': 'error', | ||
'no-console': 'off', | ||
'no-debugger': 'error', | ||
'no-duplicate-case': 'error', | ||
'no-duplicate-imports': 'error', | ||
'no-empty': 'error', | ||
'no-eval': 'error', | ||
'no-extra-bind': 'error', | ||
'no-fallthrough': 'off', | ||
'no-invalid-this': 'off', | ||
'no-irregular-whitespace': 'off', | ||
'no-new-func': 'error', | ||
'no-new-wrappers': 'error', | ||
'no-redeclare': 'error', | ||
'no-return-await': 'error', | ||
'no-sequences': 'error', | ||
'no-shadow': 'off', | ||
'no-sparse-arrays': 'error', | ||
'no-template-curly-in-string': 'error', | ||
'no-throw-literal': 'error', | ||
'no-undef-init': 'error', | ||
'no-underscore-dangle': 'off', | ||
'no-unsafe-finally': 'error', | ||
'no-unused-labels': 'error', | ||
'no-var': 'error', | ||
'object-shorthand': 'error', | ||
'one-var': ['error', 'never'], | ||
'prefer-arrow/prefer-arrow-functions': [ | ||
'error', | ||
{ allowStandaloneDeclarations: true }, | ||
], | ||
'prefer-const': 'error', | ||
'prefer-object-spread': 'error', | ||
radix: 'error', | ||
'react/display-name': 'off', | ||
'react/jsx-boolean-value': 'off', | ||
'react/jsx-curly-spacing': 'off', | ||
'react/jsx-equals-spacing': 'off', | ||
'react/jsx-key': 'error', | ||
'react/jsx-no-bind': [ | ||
'error', | ||
{ allowArrowFunctions: true, allowBind: true }, | ||
], | ||
'react/jsx-no-comment-textnodes': 'error', | ||
'react/jsx-no-duplicate-props': 'error', | ||
'react/jsx-no-target-blank': 'error', | ||
'react/jsx-no-undef': 'error', | ||
'react/jsx-uses-react': 'error', | ||
'react/jsx-uses-vars': 'error', | ||
'react/jsx-wrap-multilines': 'off', | ||
'react/no-children-prop': 'error', | ||
'react/no-danger-with-children': 'error', | ||
'react/no-deprecated': 'error', | ||
'react/no-direct-mutation-state': 'error', | ||
'react/no-find-dom-node': 'error', | ||
'react/no-is-mounted': 'error', | ||
'react/no-render-return-value': 'error', | ||
'react/no-string-refs': 'error', | ||
'react/no-unescaped-entities': ['error', { forbid: ['>', '}'] }], | ||
'react/no-unknown-property': 'error', | ||
'react/no-unsafe': 'off', | ||
'react/prop-types': 'off', | ||
'react/react-in-jsx-scope': 'error', | ||
'react/require-render-return': 'error', | ||
'react/self-closing-comp': [ | ||
'error', | ||
{ | ||
component: true, | ||
html: true, | ||
}, | ||
], | ||
'space-in-parens': ['off', 'never'], | ||
'spaced-comment': [ | ||
'error', | ||
'always', | ||
{ | ||
markers: ['/'], | ||
}, | ||
], | ||
'use-isnan': 'error', | ||
'valid-typeof': 'off', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,43 @@ | ||
name: Tests | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "build" | ||
lint: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
# This workflow contains a single job called "build" | ||
lint: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 1 | ||
- name: Set up Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.7 | ||
- name: Set PY | ||
run: | | ||
echo 'PY<<EOF' >> $GITHUB_ENV | ||
echo "$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" >> $GITHUB_ENV | ||
echo 'EOF' >> $GITHUB_ENV | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} | ||
- uses: pre-commit/action@v1.0.1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 1 | ||
- name: Run docker test | ||
run: make unit_test | ||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 1 | ||
- name: Set up Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.7 | ||
- name: Set PY | ||
run: | | ||
echo 'PY<<EOF' >> $GITHUB_ENV | ||
echo "$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" >> $GITHUB_ENV | ||
echo 'EOF' >> $GITHUB_ENV | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} | ||
- uses: pre-commit/action@v1.0.1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 1 | ||
- name: Run docker test | ||
run: make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.