score:1
Accepted answer
For the meanwhile, I've removed lang="ts"
from my <script>
tag in the .vue component file
score:-1
eslintrc:
module.exports = {
root: true,
env: {
node: true
},
extends: ['plugin:vue/essential', '@vue/prettier', '@vue/typescript'],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'prettier/prettier': [
'warn',
{
printWidth: 140,
jsxBracketSameLine: true,
singleQuote: true,
'no-multiple-empty-lines': ['error', { max: 2 }]
}
]
},
parserOptions: {
parser: 'typescript-eslint-parser'
}
};
score:-1
tsconfig:
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"strict": true,
"jsx": "preserve",
"importHelpers": true,
"moduleResolution": "node",
"experimentalDecorators": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"baseUrl": ".",
"types": [
"webpack-env",
"jquery"
],
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
},
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"src/**/*.vue",
"tests/**/*.ts",
"tests/**/*.tsx"
],
"exclude": [
"node_modules"
]
}
score:1
I think the issue is on the line :
const canvas = <HTMLCanvasElement> document.getElementById('myChart');
because of the case, you can use the as syntax to avoid the lint issue
const canvas = document.getElementById('myChart') as HTMLCanvasElement;
If you still have an issue check you .eslint.*, mine is like this:
module.exports = {
root: true,
env: {
node: true,
},
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
},
plugins: ['vue','typescript'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:vue/essential',
'@vue/typescript',
],
}
Source: stackoverflow.com
Related Query
- VueJS TypeScript using ChartJS - Parsing error: '}' expected
- How to work out Chartjs using TypeScript with Chartjs.definitelyTyped from github
- How to update a chart using VueJS and ChartJS
- How to get Data from API to display chart using chartjs in Vuejs
- Type error when config ChartJs in Typescript
- Flickering of charts and getcontext error with chartjs in the context of Vuejs
- "Maximum call stack size" Error When Adding Data to Chartjs Using Props With Fetch (Vue/Chartjs)
- VueJS + Chartjs - Chart only renders after code change
- 'require is not defined' error when attempting to use chartjs in javascript code
- Rest api / json error while using it with react chartjs
- Error Message when using ChartJS with React
- How to run Chart.js samples using source code
- Type error in using chartjs and tc-angular-chartjs
- Using ChartJs In a VueJs component
- Code for Chartjs Typescript definition file
- Rest Api data fetching error while using chartjs
- Display line chart with connected dots using chartJS
- react-chartjs-2 with chartJs 3: Error "arc" is not a registered element
- Dynamically update the options of a chart in chartjs using Javascript
- TimeSeries scale in ChartJS 3.0.2. brings error "This method is not implemented: either no adapter can be found or an incomplete integration was ..."
- chartjs + Angular6 is not showing charts or any error
- Change point color on click using ChartJS
- TypeError: Cannot read property 'defaults' of undefined when using the react wrapper of chartjs
- Vuejs with ChartJS populate from API
- Reactive Vue Chart.js component using Typescript
- Usage of ChartJS v3 with TypeScript and Webpack
- How to access labels array using chart plugin (Chart.pluginService.register) in Chartjs 2.x?
- Chartjs - show elements in all datasets on hover using bar chart
- Draw two plots using chartjs over one another with transparency
- Gradient color for each bar in a bar graph using ChartJS
More Query from same tag
- Create chart using one of the given javascript libraries
- How to reorganize data to display how many times a string appears in an array object?
- React + Chart.js 2.0: How to put a label inside of a doughnut chart?
- chart.js v 2.0.1 line, scatter chart pointRadius bug or I'm doing it wrong
- Bar chart with two sets of labels in Quickchart
- Chartjs time plot xAxis shows year 1970
- Send Chart.js as HTML and then render via ajax
- Template variable injection in JS script
- Changing the label of chart
- Hiding xAxis labels when using Chart.js
- ChartJS Recreate Chart
- Chart.js - How to create a different global configuration between the x axis and the y axis
- how to use vuechartkick in nuxt js
- Chart.js: summing number of items in active/shown datasets on yAxes of pie chart
- On hover bar is overlapped by label chartjs
- How to make the x-axis start from zero in chartjs-plugin-streaming?
- How to use Real time chart in react?
- How to access all data in a function with ChartJs?
- chart.js number of labels equal to number of datapoints
- Tooltip overriding the text in chart js
- Chartjs charts drawing with the same colour after update
- How to add text to chart.js data?
- How to iterate over array elements inside objects in javascript
- Html canvas element resets width and height to zero after drag/drop
- ChartJS change monthly labels as time/date
- Charts.js v2: always show custom (html) tooltips on chart
- Chart JS Replace All Dataset Data
- labelling the pop up Chart js
- Chart.js issue in plotting numeric X and Y in line chart
- Use outside variables inside a TypeScript function.