Skip to content

Commit 2c94174

Browse files
committed
From code review
1 parent 912c247 commit 2c94174

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

README.md

+11-10
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ npm install eslint-config-brightspace
1212

1313
## Usage
1414

15-
Shared configurations can be directly exported or included as part of a custom configuration in the `eslint.config..js` file.
15+
Shared configuration, they need to exported from the `eslint.config.js` file on the root directory.
1616
```js
17-
export { nodeConfig as default } from './index.js';
17+
export { nodeConfig as default } from 'eslint-config-brightspace/index.js';
1818
```
1919

20+
They can also be included as part of a custom configuration.
2021
```js
2122
import { nodeConfig } from 'eslint-config-brightspace';
2223

@@ -26,19 +27,19 @@ export default [
2627
];
2728
```
2829

29-
### Utils
30+
### Additional File Extensions
3031

31-
Since the `--ext` flag is deprecated, include extensions by using the `addExtenstion` function from `utils.js`.
32+
Include extensions beyond `.js` files using the `addExtenstion` helper function:
3233
```js
33-
import { nodeConfig } from 'eslint-config-brightspace';
34-
34+
import { addExtensions, nodeConfig } from 'eslint-config-brightspace';
3535
export default addExtensions(nodeConfig, ['.js','.html']);
3636
```
3737

38-
To include different configurations for specific directories, use the `setDirectoryConfigs` function from `utils.js`. This replaces the [configuration hierarchy](https://eslint.org/docs/v8.x/use/configure/configuration-files#cascading-and-hierarchy) from `eslint8`. To use it, include the global configuration and specify the directory configurations, these will apply to all files inside the directory and recursively to any of its subdirectories.
38+
### Different Configurations for Different Directories
39+
40+
To include different configurations for specific directories, use the `setDirectoryConfigs` helper function. This replaces the [configuration hierarchy](https://eslint.org/docs/v8.x/use/configure/configuration-files#cascading-and-hierarchy) from `eslint8`. To use it, include the global configuration and specify the directory configurations, these will apply to all files inside the directory and recursively to any of its subdirectories.
3941
```js
40-
import { setDirectoryConfigs } from 'eslint-config-brightspace/utils.js';
41-
import { litConfig, nodeConfig, testingConfig } from 'eslint-config-brightspace';
42+
import { litConfig, nodeConfig, setDirectoryConfigs, testingConfig } from 'eslint-config-brightspace';
4243

4344
export default setDirectoryConfigs(
4445
litConfig,
@@ -63,7 +64,7 @@ Note that each set configuration will force all prior configurations to ignore i
6364
Example:
6465

6566
```js
66-
export { nodeConfig as default } from './index.js';
67+
export { nodeConfig as default } from 'eslint-config-brightspace/index.js';
6768
```
6869

6970
See the [eslint rules](https://eslint.org/docs/latest/rules/) for more details on rule configuration. See the [eslint shareable configs](https://eslint.org/docs/latest/extend/shareable-configs.html) for more details on creating configs.

index.js

+1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ export { default as litConfig } from './configs/lit.js';
44
export { default as nodeConfig } from './configs/node.js';
55
export { default as reactConfig } from './configs/react.js';
66
export { default as testingConfig } from './configs/testing.js';
7+
export { addExtensions, setDirectoryConfigs } from './utils.js';
78

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"version": "1.3.1",
44
"description": "Common Brightspace eslint configs.",
55
"exports": {
6-
".": "./index.js",
7-
"./utils.js": "./utils.js"
6+
".": "./index.js"
87
},
98
"type": "module",
109
"scripts": {

0 commit comments

Comments
 (0)