I'm struggling with using semicolons in my typescript files due to an error thrown by eslint. The error message says "Extra semicolon.eslint@typescript-eslint/semi." I checked the documentation and found a solution that involves modifying my eslint configuration file like so:
"rules": {
// Note: you must disable the base rule as it can report incorrect errors
"semi": "off",
"@typescript-eslint/semi": "warn"
}
The issue is that my eslint file has a .js extension instead of .json, preventing me from adding ""@typescript-eslint/semi": "warn"" without encountering an error.
Update: here is my eslit.js file
module.exports = {
env: {
browser: true,
es2021: true
},
extends: [
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'standard-with-typescript'
],
overrides: [],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json']
},
plugins: ['react'],
rules: {
semi: 'off'
}
};