Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions modules/eslint-plugin/scripts/generate-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { NgRxRule } from '../src/rule-creator';
rule.meta.docs?.requiresTypeChecking === true;

writeConfig('all', (rule) => !isTypeChecked(rule));
writeConfig('allTypeChecked', (_rule) => true);
writeConfig('all-type-checked', (_rule) => true);

writeConfig(
'store',
Expand All @@ -26,7 +26,7 @@ import { NgRxRule } from '../src/rule-creator';
'effects',
(rule) => isModule(rule, 'effects') && !isTypeChecked(rule)
);
writeConfig('effectsTypeChecked', (rule) => isModule(rule, 'effects'));
writeConfig('effects-type-checked', (rule) => isModule(rule, 'effects'));

writeConfig(
'component-store',
Expand All @@ -42,19 +42,19 @@ import { NgRxRule } from '../src/rule-creator';
'signals',
(rule) => isModule(rule, 'signals') && !isTypeChecked(rule)
);
writeConfig('signalsTypeChecked', (rule) => isModule(rule, 'signals'));
writeConfig('signals-type-checked', (rule) => isModule(rule, 'signals'));

async function writeConfig(
configName:
| 'all'
| 'allTypeChecked'
| 'all-type-checked'
| 'store'
| 'effects'
| 'effectsTypeChecked'
| 'effects-type-checked'
| 'component-store'
| 'operators'
| 'signals'
| 'signalsTypeChecked',
| 'signals-type-checked',
predicate: (rule: NgRxRule) => boolean
) {
const rulesForConfig = Object.entries(rulesForGenerate).filter(
Expand Down
2 changes: 1 addition & 1 deletion modules/eslint-plugin/spec/exported-rules.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('ESLint V9', () => {
rules.length
);
});
test('there is a difference between typed checke rules ', () => {
test('there is a difference between typed checked rules ', () => {
expect(
Object.keys((configs.allTypeChecked[1] as any).rules).length
).toBeGreaterThan(Object.keys((configs.all[1] as any).rules).length);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default (
},
},
{
name: 'ngrx/allTypeChecked',
name: 'ngrx/all-type-checked',
languageOptions: {
parser,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default (
},
},
{
name: 'ngrx/effectsTypeChecked',
name: 'ngrx/effects-type-checked',
languageOptions: {
parser,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default (
},
},
{
name: 'ngrx/signalsTypeChecked',
name: 'ngrx/signals-type-checked',
languageOptions: {
parser,
},
Expand Down
6 changes: 6 additions & 0 deletions modules/eslint-plugin/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
import { rules } from './rules';
import all from './configs/all.json';
import allTypeChecked from './configs/all-type-checked';
import componentStore from './configs/component-store.json';
import effects from './configs/effects.json';
import effectsTypeChecked from './configs/effects-type-checked';
import store from './configs/store.json';
import operators from './configs/operators.json';
import signals from './configs/signals.json';
import signalsTypeChecked from './configs/signals-type-checked';

export = {
configs: {
all,
'all-type-checked': allTypeChecked,
'component-store': componentStore,
effects: effects,
'effects-type-checked': effectsTypeChecked,
store: store,
operators: operators,
signals: signals,
'signals-type-checked': signalsTypeChecked,
},
rules,
};
6 changes: 3 additions & 3 deletions modules/eslint-plugin/v9/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import {
version as packageVersion,
} from '../package.json';
import all from '../src/configs/all';
import allTypeChecked from '../src/configs/all-type-checked';
import store from '../src/configs/store';
import effects from '../src/configs/effects';
import effectsTypeChecked from '../src/configs/effects-type-checked';
import componentStore from '../src/configs/component-store';
import operators from '../src/configs/operators';
import signals from '../src/configs/signals';
import allTypeChecked from '../src/configs/allTypeChecked';
import effectsTypeChecked from '../src/configs/effectsTypeChecked';
import signalsTypeChecked from '../src/configs/signalsTypeChecked';
import signalsTypeChecked from '../src/configs/signals-type-checked';

const meta = { name: packageName, version: packageVersion };

Expand Down
26 changes: 13 additions & 13 deletions projects/www/src/app/pages/guide/eslint-plugin/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Some rules also include a recommendation or an automatic fix using `ng lint --fi

## Configuration and Usage

### ESLint v9
### ESLint v9 (Flat Config)

To use the NgRx ESLint Plugin with ESLint v9, include the desired configurations within your ESLint configuration file (e.g. `eslint.config.js`).
Optionally override some rules via the `rules` property.
Expand Down Expand Up @@ -72,7 +72,7 @@ module.exports = tseslint.config({
});
```

### ESLint v8
### ESLint v8 (Legacy Config)

To use the NgRx ESLint Plugin with ESLint v8, add it to your ESLint file (e.g. `.eslintrc.json`).
Add the `@ngrx` plugin to the `plugins` section and add the rules you want to use within your project to the `rules` section.
Expand Down Expand Up @@ -194,16 +194,16 @@ This is useful if you only use a specific package, as it only includes the rules
<!-- DO NOT EDIT, this table is automatically generated-->
<!-- CONFIGURATIONS-CONFIG:START -->

| Name |
| -------------------------------------------------------------------------------------------------------------------------- |
| [all](https://github.com/ngrx/platform/blob/main/modules/eslint-plugin/src/configs/all.json) |
| [allTypeChecked](https://github.com/ngrx/platform/blob/main/modules/eslint-plugin/src/configs/allTypeChecked.json) |
| [component-store](https://github.com/ngrx/platform/blob/main/modules/eslint-plugin/src/configs/component-store.json) |
| [effects](https://github.com/ngrx/platform/blob/main/modules/eslint-plugin/src/configs/effects.json) |
| [effectsTypeChecked](https://github.com/ngrx/platform/blob/main/modules/eslint-plugin/src/configs/effectsTypeChecked.json) |
| [operators](https://github.com/ngrx/platform/blob/main/modules/eslint-plugin/src/configs/operators.json) |
| [signals](https://github.com/ngrx/platform/blob/main/modules/eslint-plugin/src/configs/signals.json) |
| [signalsTypeChecked](https://github.com/ngrx/platform/blob/main/modules/eslint-plugin/src/configs/signalsTypeChecked.json) |
| [store](https://github.com/ngrx/platform/blob/main/modules/eslint-plugin/src/configs/store.json) |
| Name |
| ------------------------------------------------------------------------------------------------------------------------------ |
| [all-type-checked](https://github.com/ngrx/platform/blob/main/modules/eslint-plugin/src/configs/all-type-checked.json) |
| [all](https://github.com/ngrx/platform/blob/main/modules/eslint-plugin/src/configs/all.json) |
| [component-store](https://github.com/ngrx/platform/blob/main/modules/eslint-plugin/src/configs/component-store.json) |
| [effects-type-checked](https://github.com/ngrx/platform/blob/main/modules/eslint-plugin/src/configs/effects-type-checked.json) |
| [effects](https://github.com/ngrx/platform/blob/main/modules/eslint-plugin/src/configs/effects.json) |
| [operators](https://github.com/ngrx/platform/blob/main/modules/eslint-plugin/src/configs/operators.json) |
| [signals-type-checked](https://github.com/ngrx/platform/blob/main/modules/eslint-plugin/src/configs/signals-type-checked.json) |
| [signals](https://github.com/ngrx/platform/blob/main/modules/eslint-plugin/src/configs/signals.json) |
| [store](https://github.com/ngrx/platform/blob/main/modules/eslint-plugin/src/configs/store.json) |

<!-- CONFIGURATIONS-CONFIG:END -->