-
Notifications
You must be signed in to change notification settings - Fork 65
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
Non-null assertion #64
Comments
Getting the same issue with a fresh nuxt + typescript setup |
save error, super annoying ! |
finally found the reason, simply remove parserOptions: {
parser: 'babel-eslint'
} in the |
Great, it's worked for me. Thanks. |
@nuxtjs/eslint-config-typescript set a TypeScript parser, so you need to not override it. (i.e. #64 (comment)). Thanks @axe-me |
Hi, I have a nuxt+typescript project and I'm getting this error:
my tsconfig.json:
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"moduleResolution": "node",
"lib": [
"esnext",
"esnext.asynciterable",
"dom"
],
"esModuleInterop": true,
"allowJs": true,
"sourceMap": true,
"strict": true,
"noEmit": true,
"baseUrl": ".",
"paths": {
"~/": [
"./"
],
"@/": [
"./"
]
},
"types": [
"@types/node",
"@nuxt/types"
],
"experimentalDecorators": true,
"resolveJsonModule": true
},
"exclude": [
"node_modules"
]
}
my .eslintrc.js:
module.exports = {
root: true,
env: {
browser: true,
node: true
},
parserOptions: {
parser: 'babel-eslint'
},
extends: [
'@nuxtjs',
'plugin:nuxt/recommended',
'@nuxtjs/eslint-config-typescript'
],
// add your custom rules here
rules: {
"no-console": "off"
}
}
my package.json has these packages:
"dependencies": {
"@nuxtjs/axios": "^5.6.0",
"@nuxtjs/pwa": "^3.0.0-0",
"bootstrap": "^4.3.1",
"bootstrap-vue": "^2.0.1",
"nuxt": "^2.9.2",
"nuxt-property-decorator": "^2.4.0"
},
"devDependencies": {
"@nuxt/typescript-build": "^0.2.8",
"@nuxtjs/eslint-config": "^1.1.2",
"@nuxtjs/eslint-config-typescript": "^0.1.3",
"@nuxtjs/eslint-module": "^1.1.0",
"babel-eslint": "^10.0.3",
"eslint": "^6.4.0",
"eslint-plugin-nuxt": ">=0.4.3",
"vuex-module-decorators": "^0.10.1"
}
I can't use the non-null assertion. How can I fix this problem?
This configuration was made following the instructions in https://typescript.nuxtjs.org
Thanks.
The text was updated successfully, but these errors were encountered: