Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update eslint-config-eslint exports #17336

Merged
merged 8 commits into from Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions eslint.config.js
Expand Up @@ -31,7 +31,7 @@ const eslintPluginRulesRecommendedConfig = require("eslint-plugin-eslint-plugin/
const eslintPluginTestsRecommendedConfig = require("eslint-plugin-eslint-plugin/configs/tests-recommended");
const globals = require("globals");
const merge = require("lodash.merge");
const baseConfig = require("eslint-config-eslint");
const eslintConfigESLintCJS = require("eslint-config-eslint/cjs");

//-----------------------------------------------------------------------------
// Helpers
Expand Down Expand Up @@ -75,7 +75,7 @@ function createInternalFilesPatterns(pattern = null) {
}

module.exports = [
...baseConfig,
...eslintConfigESLintCJS,
{
ignores: [
"build/**",
Expand Down
26 changes: 24 additions & 2 deletions packages/eslint-config-eslint/README.md
Expand Up @@ -22,11 +22,33 @@ npm install eslint-config-eslint --save-dev

## Usage

### ESM (`"type":"module"`) projects

In your `eslint.config.js` file, add:

```js
const eslintConfig = require("eslint-config-eslint");
module.exports = eslintConfig;
import eslintConfigESLint from "eslint-config-eslint";

export default [
...eslintConfigESLint
];
```

**Note**: This configuration array contains configuration objects with the `files` property.

* `files: ["**/*.js"]`: ESM-specific configurations.
* `files: ["**/*.cjs"]`: CommonJS-specific configurations.

### CommonJS projects

In your `eslint.config.js` file, add:

```js
const eslintConfigESLintCJS = require("eslint-config-eslint/cjs");

module.exports = [
...eslintConfigESLintCJS
];
```

### Where to ask for help?
Expand Down