Comments (8)
"@typescript-eslint/eslint-plugin": "^1.9.0",
"@typescript-eslint/parser": "^1.9.0",
"eslint": "^5.16.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-friendly-formatter": "^4.0.1",
"eslint-import-resolver-webpack": "^0.11.1",
"eslint-loader": "^2.1.2",
"eslint-plugin-import": "^2.17.3",
"eslint-plugin-vue": "^5.2.2",
from typescript-eslint.
Still issue. It happens when { "requireForBlockBody": true } otherwise it don't happen.
Maybe it will be fixed one day :) Issue number 14. Is it oldest one not fixed i wonder
happens on latest eslint 7 and the fix action totally break code
from typescript-eslint.
This is fixed in eslint v7.4.0
from typescript-eslint.
@JamesHenry @armano2 I'm still seeing this on version 1.4.2
. I have a file in my repo called components/util/test.ts
:
const foo = <T>(bar: any): void => {
// Do nothing
}
which produces the following when I run eslint
:
jasonhoch@hoch1:~/code/newfront-app
15:34:48$ yarn eslint components/util/test.ts
yarn run v1.13.0
$ /Users/jasonhoch/code/newfront-app/node_modules/.bin/eslint components/util/test.ts
/Users/jasonhoch/code/newfront-app/components/util/test.ts
1:7 warning 'foo' is assigned a value but never used @typescript-eslint/no-unused-vars
1:13 error Expected parentheses around arrow function argument having a body with curly braces arrow-parens
1:17 warning 'bar' is defined but never used @typescript-eslint/no-unused-vars
1:22 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
3:2 error Missing semicolon semi
✖ 5 problems (2 errors, 3 warnings)
2 errors and 0 warnings potentially fixable with the `--fix` option.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
(See the error at 1:13
). Here is my .eslintrc.js
file:
module.exports = {
'extends': [
'airbnb',
'plugin:@typescript-eslint/recommended',
],
'env': {
'jest': true,
},
'overrides': [{
'files': ['*.ts', '*.tsx'],
'rules': {
'indent': 'off', // Conflicts
'semi': ['error', 'always'], // Conflicts
},
}],
'parser': '@typescript-eslint/parser',
'parserOptions': {
'project': './tsconfig.json',
},
'plugins': [
'@typescript-eslint',
'import',
],
'rules': {
'arrow-body-style': ['off'],
'jsx-a11y/anchor-is-valid': ['error', {
'components': ['Link'],
'aspects': ['invalidHref', 'preferButton'],
}],
'jsx-quotes': ['warn', 'prefer-single'],
'react/jsx-filename-extension': ['warn', { 'extensions': ['.js', '.jsx', '.tsx'] }],
'react/jsx-closing-tag-location': ['off'],
'react/jsx-curly-brace-presence': ['error', { 'props': 'never', 'children': 'ignore' } ],
'react/jsx-one-expression-per-line': ['off'],
'react/prop-types': ['off'],
'semi': ['warn', 'never'],
'@typescript-eslint/explicit-function-return-type': ['warn', { 'allowExpressions': true }],
'@typescript-eslint/indent': ['error', 2],
},
'settings': {
'import/resolver': {
'typescript': {},
},
},
}
and the lines in my package.json
:
"devDependencies": {
...
"@typescript-eslint/eslint-plugin": "^1.4.2",
"@typescript-eslint/parser": "^1.4.2",
...
}
We've had a smooth experience moving over from TSLint, with this one glitch. Looking at #176, it looks like you guys test for this case. Any idea what the problem could be? Let me know if I can help!
from typescript-eslint.
I still get false positive.
@typescript-eslint/parser
version
1.7.1-alpha-28
rule
"arrow-parens" : ["as-needed", { "requireForBlockBody": true }]
// Expected parentheses around arrow function argument having a body with curly braces.eslint(arrow-parens)
const foo = <T>(t: T): void => { console.info(t); }
// the following is correct
const foo = (t) => { console.info(t); }
from typescript-eslint.
You have the missing piece of the puzzle!
The config that causes it to fail!
from typescript-eslint.
I've the same problem, when will this problem get fixed and published?
from typescript-eslint.
I'm also experiencing this with default airbnb
arrow-parens
config:
'arrow-parens': ['error', 'as-needed', {
requireForBlockBody: true,
}],
// Expected parentheses around arrow function argument having a body with curly braces.
export const makeRequest = async <T>(
method: RequestMethod,
urlPath: string,
body: {} = {},
extraHeaders: RequestHeaders = {},
throwGeneralError: boolean = true,
suppressErrors: boolean = false,
): Promise<T | null> => {
...
};
"eslint": "^5.15.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.12.4",
"@typescript-eslint/eslint-plugin": "^1.9.0",
"@typescript-eslint/parser": "^1.9.0",
from typescript-eslint.
Related Issues (20)
- Bug: Error while loading rule '@typescript-eslint/await-thenable' HOT 1
- Docs: Separate FAQs into discrete sections
- Enhancement: Remove AST properties deprecated in v6
- Enhancement: Remove deprecated emitDecoratorMetadata
- Enhancement: Raise minimum versions of dependencies for v8 HOT 7
- Enhancement: Remove deprecated getTypeArguments from type-utils HOT 1
- Enhancement: Remove IsNullableTypeOptions from type-utils
- Bug: [prefer-readonly-parameter-types] Doesn't work on `DeepReadonly` from `ts-essentials`, `utility-types`, and `type-fest` HOT 7
- Repo: Ideas for avoiding drift between a renamed rule and the original HOT 5
- Rule proposal: "no-any?" to disallow `any` in function parameters with type annotation HOT 2
- Rule proposal: prefer-structured-clone HOT 3
- Repo: handle exceptions that occur while testing a rule better HOT 2
- Configs: Please add consistent-type-imports and consistent-type-exports for stylistic-type-checked HOT 1
- Docs: jot down comon patterns for rule development HOT 1
- Bug: [unbound-method] Does not fail for destructured parameters HOT 3
- Repo: Set up v8 alpha/canary version publishing
- Bug: [explicit-function-return-type] false positive on defaulting parameters
- [disable-type-checked-config] missing `@typescript-eslint/explicit-function-return-type` rule HOT 3
- Bug: [no-floating-promises] False positive for spread arguments in then() HOT 3
- Docs: Document how to import and configure the parser for flat config HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typescript-eslint.