Defines global linting rules for Corva.AI frontend projects
Defines global linting rules for Corva.AI UI projects
Install lib
``js`
npm i -D @corva/eslint-config-browser
1. Add these libs to the package.json
`js`
"@typescript-eslint/eslint-plugin": "8.52.0",
"@typescript-eslint/parser": "8.52.0",
"eslint": "9.39.2",
"eslint-webpack-plugin": "5.0.2",
2. Update config-overrides.js
`js
const path = require('path');
const { getWebpackConfig } = require('@corva/dc-platform-shared/cjs');
const { merge } = require('webpack-merge');
const ESLintPlugin = require('eslint-webpack-plugin');
module.exports = (env, argv) => {
return merge(getWebpackConfig(env, argv), {
resolve: {
alias: {
'~': path.resolve(__dirname, 'src'),
},
},
plugins: [
new ESLintPlugin({
extensions: ['ts', 'tsx'],
emitError: true,
emitWarning: true,
failOnError: false,
failOnWarning: false,
}),
],
devServer: {
client: {
overlay: false,
},
},
});
};
`
3. remove old eslint config and add config.eslint.js file
`js
import config from '@corva/eslint-config-browser';
export default config;
``