-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[WIP] Pursuing type-safety #2818
Closed
Closed
Changes from all commits
Commits
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 |
---|---|---|
@@ -1,16 +1,12 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = tab | ||
indent_size = 2 | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
|
||
[test/**/expected.css] | ||
indent_style = tab | ||
insert_final_newline = false | ||
trim_trailing_whitespace = true | ||
|
||
[{package.json,.travis.yml,.eslintrc.json}] | ||
indent_style = space | ||
indent_size = 2 | ||
[.travis.yml] | ||
indent_style = space |
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,52 @@ | ||
module.exports = { | ||
root: true, | ||
|
||
rules: { | ||
// automatically fixable stylistic rules | ||
'arrow-spacing': 2, | ||
'comma-dangle': [2, 'never'], | ||
'dot-notation': 2, | ||
'eol-last': [2, 'never'], | ||
indent: [2, 'tab', { SwitchCase: 1 }], | ||
'keyword-spacing': [2, { before: true, after: true }], | ||
'no-trailing-spaces': 2, | ||
'no-var': 2, | ||
'object-shorthand': [2, 'always'], | ||
'one-var': [2, 'never'], | ||
'prefer-arrow-callback': 2, | ||
'prefer-const': [2, { destructuring: 'all' }], | ||
'quote-props': [2, 'as-needed'], | ||
semi: [2, 'always'], | ||
'space-before-blocks': [2, 'always'], | ||
|
||
// eslint:recommended overrides | ||
'no-cond-assign': 0, | ||
'no-inner-declarations': 0, | ||
'no-mixed-spaces-and-tabs': [2, 'smart-tabs'] | ||
}, | ||
|
||
plugins: ['@typescript-eslint'], | ||
|
||
extends: [ | ||
'eslint:recommended', | ||
'plugin:import/errors', | ||
'plugin:import/warnings', | ||
'plugin:import/typescript' | ||
// TODO: fix typerscript files | ||
// 'plugin:@typescript-eslint/recommended', | ||
], | ||
|
||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaVersion: 9, | ||
sourceType: 'module', | ||
project: './tsconfig.json' | ||
}, | ||
|
||
env: { | ||
es6: true, | ||
browser: true, | ||
node: true, | ||
mocha: true | ||
} | ||
}; |
This file was deleted.
Oops, something went wrong.
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 +1,2 @@ | ||
*.svelte linguist-language=HTML | ||
* text=auto eol=lf | ||
*.svelte linguist-language=HTML |
This file was deleted.
Oops, something went wrong.
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,9 @@ | ||
module.exports = { | ||
arrowParens: 'avoid', | ||
endOfLine: 'lf', | ||
quoteProps: 'as-needed', | ||
semi: true, | ||
singleQuote: true, | ||
trailingComma: 'none', | ||
useTabs: true | ||
}; |
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.
As far as I'm aware,
ecmaVersion
andsourceType
are not required to configure@typescript-eslint/parser
. It should pick up the relevant settings fromtsconfig.json
.I've also found setting
tsconfigRootDir: __dirname,
to be useful in some scenarios like VS Code extensions.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.
I thought so too, but it complains about
Parsing error: ImportDeclaration should appear when the mode is ES6 and in the module context
for some reason.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.
Had a deeper dive into my own config and found that even though I leave these values out, a preset I extend from is actually adding it (
eslint-config-airbnb-base
). Sorry, I didn't realise. You're right in that it throws the error!Learnt something new :)