This package now provides a browser configuration in addition to the Node.js configuration.
npm install --save-dev @hs-web-team/eslint-config-nodeCreate an eslint.config.js file in your browser/React project:
import wtBrowserConfig from '@hs-web-team/eslint-config-node/browser';
export default [
...wtBrowserConfig,
// Add your custom overrides here
{
rules: {
// Custom rules
},
},
];The browser configuration includes:
- ESLint recommended rules for JavaScript
- TypeScript support with typescript-eslint
- React support with eslint-plugin-react
- React Hooks rules with eslint-plugin-react-hooks
- Accessibility rules with eslint-plugin-jsx-a11y
- Browser globals (window, document, localStorage, etc.)
- Jest environment for testing
- Custom globals: jQuery, $, Invoca
The configuration adapts rules from @hs-web-team/eslint-config-browser:
- Code Style: 120 character line length, single quotes, trailing commas
- Console: Allows
console.warnandconsole.error - React: Flexible React component patterns
- Formatting: Relaxed indentation and linebreak rules (use Prettier for formatting)
If you're migrating from @hs-web-team/eslint-config-browser (ESLint 8):
- Update your
eslint.config.jsto use flat config format - Replace
extends: '@hs-web-team/eslint-config-browser'with the import shown above - Ensure you're using Node.js >= 22
- Review and adapt any custom rules in your project
The configuration applies to:
- JavaScript:
**/*.{js,mjs,cjs,jsx} - TypeScript:
**/*.{ts,mts,cts,tsx}
The following directories are automatically ignored:
node_modulesdistbuild.nextcoverageeslint.config.js