Decorator: Unexpected use of 'name'. no-restricted-globals
See original GitHub issueenv info
- ESLint Version: 7.14.0
- Node Version: 12.13.1
- npm Version:6.4.10
parser
Configuration
env: {
browser: true,
commonjs: true,
es6: true,
node: true,
mocha: true,
},
parser: '@typescript-eslint/parser',
extends: ['airbnb-base', 'plugin:@typescript-eslint/recommended'],
globals: {
expect: false,
},
rules: {
'no-use-before-define': 0,
'max-classes-per-file': [0, 1],
'@typescript-eslint/member-delimiter-style': [2, { multiline: { delimiter: 'none' } }],
'@typescript-eslint/no-use-before-define': [2],
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/ban-types': 0,
},
Code
export default class CiController extends Base {
@post('/docker-image/record')
async createDockerImageRecord(@parseRequest({
body: {
name: {
type: 'string',
required: true,
},
tag: {
type: 'string',
required: true,
},
jobId: {
type: 'number',
required: true,
},
pId: {
type: 'number',
required: true,
},
packageLockStr: {
type: 'string',
required: true,
},
},
}) paramters: {
body: {
name: string
tag: string
jobId: number
pId: number
packageLockStr: string
}
}): IResult<any> {
const {
name,
tag,
jobId,
pId,
packageLockStr,
} = paramters.body
}
}
command
eslint
result
What did you expect to happen? This is not declaring a variable. Sholdn’t trigger this rule
What actually happened? Please include the actual, raw output from ESLint. /Users/qiongen/Desktop/red/fe-platform/src/app/controller/ci.ts 96:7 error Unexpected use of ‘name’ no-restricted-globals
✖ 1 problem (1 error, 0 warnings)
Are you willing to submit a pull request to fix this bug?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Javascript: Expected result. React: "Unexpected use of 'name ...
js file created by npx create-react-app yields the compiler error Unexpected use of 'name' no-restricted-globals on each line containing the ...
Read more >Unexpected use of 'name' no-restricted-globals - React.js
I was working on POST request which would create new playlist. I have a weird to me error which I tried to google...
Read more >Unexpected use of 'name' no-restricted-globals in React
Unexpected use of 'name ' no - restricted - globals in React ,solved.
Read more >Airbnb JavaScript Style Guide()
3.2 Use computed property names when creating objects with dynamic property names. Why? They allow you to define all the properties of an...
Read more >Not being able to use MDB React PRO - MDBootstrap
... Unexpected use of 'self' no-restricted-globals Line 390: 'DEBUG' is not defined no-undef Line ... Do not use import syntax to configure webpack...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Seeing this with ESLint 7.18.0 and
@typescript-eslint/parser
4.14.0 (latest version).@anikethsaha @mdjermanovic Thanks for helping. since this is a bug with
typescript-eslint
. i’ll close this issue. Thanks again!