This repository has been archived by the owner on Mar 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
chore(package): add ESLint #600
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
be899a8
chore: replace ts-lint with eslint
levithomason 46757bf
update dependencies, fix configs
layershifter 86d867e
Merge branches 'chore/unused-vars' and 'master' of https://github.com…
layershifter df3a6fa
wip!
layershifter 405fb8a
Merge branch 'master' of https://github.com/stardust-ui/react into ch…
layershifter 7c426bf
remove TSLint rule
layershifter 52ae358
revert changes in focusUtilities
layershifter ecb13b9
disable import rule for whole directory
layershifter 030b615
cleanup configs
layershifter 202d843
revert change in test
layershifter 445509f
more dependencies, rearrange configs, disable rules
layershifter 08d567b
disable more rules
layershifter db0a956
disable more rules
layershifter d05daf9
disable more rules
layershifter 1916863
restore TSLint
layershifter 60db12d
restore rules and configs
layershifter 8ddba63
fix eval issue
layershifter e424023
Merge branch 'master' into chore/unused-vars
layershifter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,5 @@ | ||
.awcache/ | ||
coverage/ | ||
dist/ | ||
dll/ | ||
node_modules/ |
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,4 @@ | ||
{ | ||
"extends": ["./packages/internal-tooling/eslint/index.js"], | ||
"root": true | ||
} |
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,19 +1,11 @@ | ||
.github/ | ||
|
||
# editor configs | ||
.idea/ | ||
.vscode/ | ||
|
||
|
||
coverage/ | ||
|
||
dist/ | ||
dll/ | ||
docs/src/componentInfo | ||
docs/src/componentMenu.json | ||
docs/src/behaviorMenu.json | ||
docs/src/exampleMenus | ||
docs/dist/ | ||
stats/ | ||
|
||
package.json |
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
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,5 @@ | ||
{ | ||
"rules": { | ||
"import/no-unresolved": "off" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have requires for Enzyme, Simulant and other stuff that it's not in direct dependencies. Currently disabled |
||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
module.exports = { | ||
extends: ['airbnb', 'plugin:prettier/recommended'], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['@typescript-eslint', 'jest', 'import', 'prettier', 'react-hooks'], | ||
env: { | ||
browser: true, | ||
'jest/globals': true, | ||
}, | ||
rules: { | ||
// False positive on arg types: | ||
// https://github.com/typescript-eslint/typescript-eslint/issues/46 | ||
// '@typescript-eslint/no-unused-vars': ['error', { args: 'none' }], | ||
'import/no-unresolved': 'off', | ||
'prettier/prettier': 'error', | ||
'react/jsx-filename-extension': ['error', { extensions: ['.js', '.tsx'] }], | ||
semi: ['error', 'never'], | ||
|
||
// Temporary disabled rules | ||
'@typescript-eslint/no-unused-vars': 'off', | ||
'jsx-a11y/click-events-have-key-events': 'off', | ||
'jsx-a11y/no-static-element-interactions': 'off', | ||
'jsx-a11y/alt-text': 'off', | ||
'jsx-a11y/anchor-is-valid': 'off', | ||
'jsx-a11y/label-has-for': 'off', | ||
'jsx-a11y/label-has-associated-control': 'off', | ||
'jsx-a11y/no-noninteractive-tabindex': 'off', | ||
'import/export': 'off', | ||
'import/first': 'off', | ||
'import/order': 'off', | ||
'import/no-dynamic-require': 'off', | ||
'import/no-extraneous-dependencies': 'off', | ||
'import/no-named-default': 'off', | ||
'import/no-useless-path-segments': 'off', | ||
'import/newline-after-import': 'off', | ||
'import/prefer-default-export': 'off', | ||
'react/button-has-type': 'off', | ||
'react/destructuring-assignment': 'off', | ||
'react/default-props-match-prop-types': 'off', | ||
'react/jsx-curly-brace-presence': 'off', | ||
'react/jsx-boolean-value': 'off', | ||
'react/jsx-no-bind': 'off', | ||
'react/jsx-one-expression-per-line': 'off', | ||
'react/jsx-pascal-case': 'off', | ||
'react/jsx-wrap-multilines': 'off', | ||
'react/no-access-state-in-setstate': 'off', | ||
'react/no-children-prop': 'off', | ||
'react/no-array-index-key': 'off', | ||
'react/no-find-dom-node': 'off', | ||
'react/jsx-no-target-blank': 'off', | ||
'react/forbid-prop-types': 'off', | ||
'react/prefer-stateless-function': 'off', | ||
'react/no-multi-comp': 'off', | ||
'react/no-unused-prop-types': 'off', | ||
'react/no-unused-state': 'off', | ||
'react/no-unescaped-entities': 'off', | ||
'react/prop-types': 'off', | ||
'react/require-default-props': 'off', | ||
'react/sort-comp': 'off', | ||
'react/no-string-refs': 'off', | ||
'react/no-render-return-value': 'off', | ||
camelcase: 'off', | ||
'class-methods-use-this': 'off', | ||
'consistent-return': 'off', | ||
'default-case': 'off', | ||
'dot-notation': 'off', | ||
'global-require': 'off', | ||
'guard-for-in': 'off', | ||
'lines-between-class-members': 'off', | ||
'no-await-in-loop': 'off', | ||
'no-bitwise': 'off', | ||
'no-case-declarations': 'off', | ||
'no-empty': 'off', | ||
'no-continue': 'off', | ||
'no-extra-boolean-cast': 'off', | ||
'no-fallthrough': 'off', | ||
'no-nested-ternary': 'off', | ||
'no-param-reassign': 'off', | ||
'no-plusplus': 'off', | ||
'no-prototype-builtins': 'off', | ||
'no-return-await': 'off', | ||
'no-return-assign': 'off', | ||
'no-restricted-globals': 'off', | ||
'no-restricted-syntax': 'off', | ||
'no-throw-literal': 'off', | ||
'no-sparse-arrays': 'off', | ||
'no-shadow': 'off', | ||
'no-undef': 'off', | ||
'no-undef-init': 'off', | ||
'no-underscore-dangle': 'off', | ||
'no-unused-expressions': 'off', | ||
'no-useless-return': 'off', | ||
'no-unused-vars': 'off', | ||
'no-empty-function': 'off', | ||
'no-useless-constructor': 'off', | ||
'no-useless-escape': 'off', | ||
'no-use-before-define': 'off', | ||
'operator-assignment': 'off', | ||
'prefer-destructuring': 'off', | ||
'spaced-comment': 'off', | ||
}, | ||
overrides: [ | ||
{ | ||
files: '**/jest.config.js', | ||
rules: { | ||
'global-require': 'off', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's safe to use |
||
}, | ||
}, | ||
{ | ||
files: '**/test/**/*.{ts,tsx}', | ||
rules: { | ||
'import/no-extraneous-dependencies': 'off', | ||
}, | ||
}, | ||
], | ||
settings: { | ||
'import/resolver': { | ||
node: { | ||
extensions: ['.js', '.jsx', '.ts', '.tsx'], | ||
}, | ||
}, | ||
}, | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
src/themes/teams/components/Icon/svg/ProcessedIcons |
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,12 @@ | ||
{ | ||
"extends": ["../internal-tooling/eslint/index.js"], | ||
"overrides": [ | ||
{ | ||
"files": "**/icons/*.tsx", | ||
"rules": { | ||
"react/prop-types": "off" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ESLint with React plugin handles these icons as React components, it will be very strange to have there |
||
} | ||
} | ||
], | ||
"root": true | ||
} |
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Paths are not great, should be fixed in ESLint 6: eslint/eslint#11388