8000 Add ESLint configuration as a package and setup for itself by cometkim · Pull Request #3 · cometkim/cometjs · GitHub
[go: up one dir, main page]

Skip to content

Add ESLint configuration as a package and setup for itself #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
May 4, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[eslint-plugin] ignore max-len for comments
  • Loading branch information
cometkim committed May 4, 2020
commit adf2d3be5c358b372e95f93c5001aa012e671109
11 changes: 10 additions & 1 deletion packages/eslint-plugin/configs/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@ module.exports = {
'eslint:recommended',
],
'rules': {
'max-len': ['error', 100],
'max-len': ['error', {
'code': 100,
'tabWidth': 2,
'ignoreComments': true,
'ignoreTrailingComments': true,
'ignoreUrls': true,
'ignoreStrings': true,
'ignoreTemplateLiterals': true,
'ignoreRegExpLiterals': true,
}],
'indent': ['error', 2],
'semi': ['error', 'always'],
'quotes': ['error', 'single'],
Expand Down
5 changes: 2 additions & 3 deletions packages/urql-utils/src/result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@ export function isDataResult<T>(result: Result<T>): result is DataResult<T> {
return Boolean(result.data);
}

export function castQueryResult<T>(result: UseQueryState<T> | UseMutationState<T>): Result<T> {
export function castQueryResult<T>(result: UseQueryState<T> | UseMutationState<T>) {
// Casting instead of guard because:
// - `result is Result<T>` is not allowed
// - `result is Omit<UseQueryState<T>, 'data'|'error'|'fetching'> & Result<T>`
// would not inferred well.
// - `result is OverrideProps<UseQueryState<T>, Result<T>>` would not inferred well.
const reasons: string[] = [];
if (!('fetching' in result)) {
reasons.push('it is not compatible with LoadingResult because `fetching` field is missing');
Expand Down
0