Package Exports
- eslint-config-blazex
- eslint-config-blazex/index.mjs
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-config-blazex) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
eslint-config-blazex
This package provides a set of extensible shared ESLint configurations using the new Flat Config format introduced in ESLint. It supports JavaScript, TypeScript, React, and Next.js projects.
Installation
To use this package, install it via npm or yarn:
npm install eslint-config-blazex --save-devor
yarn add eslint-config-blazex --devUsage
Since this package uses the Flat Config format, you need to create an eslint.config.mjs file in the root of your project and import the desired configuration.
JavaScript Config
To use the JavaScript configuration:
// eslint.config.mjs
import { configs } from 'eslint-config-blazex';
export default [
configs.javascript,
];TypeScript Config
To use the TypeScript configuration:
// eslint.config.mjs
import { configs } from 'eslint-config-blazex';
export default [
configs.typescript,
];React Config (JavaScript)
To use the React configuration for JavaScript:
// eslint.config.mjs
import { configs } from 'eslint-config-blazex';
export default [
configs.react,
];React Config (TypeScript)
To use the React configuration for TypeScript:
// eslint.config.mjs
import { configs } from 'eslint-config-blazex';
export default [
configs.react,
configs.typescript, // Include TypeScript rules if using TypeScript
];Next.js Config (JavaScript)
To use the Next.js configuration for JavaScript:
// eslint.config.mjs
import { configs } from 'eslint-config-blazex';
export default [
configs.next,
];Next.js Config (TypeScript)
To use the Next.js configuration for TypeScript:
// eslint.config.mjs
import { configs } from 'eslint-config-blazex';
export default [
configs.next,
configs.typescript, // Include TypeScript rules if using TypeScript
];Customizing Rules
If you want to customize or override specific rules, you can extend the configuration like this:
// eslint.config.mjs
import { configs } from 'eslint-config-blazex';
export default [
{
...configs.javascript,
rules: {
...configs.javascript.rules,
'no-console': 'warn', // Example: Override the no-console rule
},
},
];Available Configurations
- JavaScript:
configs.javascript - TypeScript:
configs.typescript - React (JavaScript):
configs.react - React (TypeScript): Combine
configs.reactandconfigs.typescript - Next.js (JavaScript):
configs.next - Next.js (TypeScript): Combine
configs.nextandconfigs.typescript
Exported Rules
If you need access to the individual rules for advanced use cases, you can import them like this:
import { rules } from 'eslint-config-blazex';
console.log(rules.javascript); // Logs JavaScript-specific rules
console.log(rules.typescript); // Logs TypeScript-specific rulesNotes
- This package is designed to work with ESLint's Flat Config format. Ensure you are using a compatible version of ESLint.
- For Next.js and React configurations, make sure you have the necessary plugins installed (e.g.,
eslint-plugin-react,eslint-plugin-next).
For more details, refer to the ESLint Flat Config documentation.