Skip to content

Commit b567165

Browse files
bmishwagenet
andauthored
Changes from v11.12.0 (#2029)
* Support ESLint flat config (#2020) * Allow ember-data type registry imports in `use-ember-data-rfc-395-imports` rule (#2027) * Allow ember-data type registry imports * fix lint --------- Co-authored-by: Bryan Mishkin <[email protected]> * fix lint * Release 11.12.0 * fix merge mistakes --------- Co-authored-by: Peter Wagenet <[email protected]>
1 parent 49f2690 commit b567165

16 files changed

Lines changed: 112 additions & 90 deletions

CHANGELOG.md

Lines changed: 13 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,3 @@
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12-
13-
14-
15-
16-
17-
18-
19-
20-
21-
22-
23-
24-
25-
26-
27-
28-
29-
30-
31-
32-
33-
34-
35-
36-
37-
38-
39-
40-
41-
42-
43-
44-
45-
46-
47-
481
## v12.0.0-alpha.2 (2023-11-10)
492

503
#### :bug: Bug Fix
@@ -102,6 +55,19 @@
10255
- Patrick Pircher ([@patricklx](https://github.com/patricklx))
10356

10457

58+
## v11.12.0 (2023-12-12)
59+
60+
#### :rocket: Enhancement
61+
* [#2020](https://github.com/ember-cli/eslint-plugin-ember/pull/2020) Support ESLint flat config ([@bmish](https://github.com/bmish))
62+
63+
#### :bug: Bug Fix
64+
* [#2027](https://github.com/ember-cli/eslint-plugin-ember/pull/2027) Allow ember-data type registry imports in `use-ember-data-rfc-395-imports` rule ([@wagenet](https://github.com/wagenet))
65+
66+
#### Committers: 2
67+
- Bryan Mishkin ([@bmish](https://github.com/bmish))
68+
- Peter Wagenet ([@wagenet](https://github.com/wagenet))
69+
70+
10571
## v11.11.1 (2023-08-22)
10672

10773
#### :bug: Bug Fix

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,21 @@ Or
2525
npm install --save-dev eslint-plugin-ember
2626
```
2727

28-
### 2. Modify your `.eslintrc.js`
28+
### 2. Update your config
2929

3030
```js
31-
// .eslintrc.js
31+
// eslint.config.js (flat config)
32+
const eslintPluginEmberRecommended = require('eslint-plugin-ember/configs/recommended');
33+
34+
module.exports = [
35+
...eslintPluginEmberRecommended,
36+
];
37+
```
38+
39+
or
40+
41+
```js
42+
// .eslintrc.js (legacy config)
3243
module.exports = {
3344
plugins: ['ember'],
3445
extends: [

docs/rules/use-ember-data-rfc-395-imports.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ The goal of this rule is to ease the migration to the new @ember-data packages.
1414

1515
ember-data has been split in multiple packages. For instance, its store is now released in "@ember-data/store" package. These packages have been released starting from ember-data version 3.11.
1616

17+
For TypeScript users, imports from `ember-data/types/registries/*` are still allowed since there is currently no equivalent in the new packages.
18+
1719
## Examples
1820

1921
Examples of **incorrect** code for this rule:

lib/config-legacy/base.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
module.exports = {
2+
root: true,
3+
4+
parserOptions: {
5+
ecmaVersion: 2022,
6+
sourceType: 'module',
7+
},
8+
9+
env: {
10+
browser: true,
11+
es2022: true,
12+
},
13+
14+
plugins: ['ember'],
15+
16+
overrides: [
17+
/**
18+
* We don't want to *always* have the preprocessor active,
19+
* it's only relevant on gjs and gts files to detect if eslint config is correctly setup for this files.
20+
*/
21+
{
22+
files: ['**/*.{gts,gjs}'],
23+
parser: 'eslint-plugin-ember/gjs-gts-parser',
24+
processor: 'ember/<noop>',
25+
},
26+
],
27+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const base = require('./base');
2+
const gjsRules = require('../recommended-rules-gjs');
3+
4+
module.exports = {
5+
...base,
6+
rules: gjsRules,
7+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const base = require('./base');
2+
const gtsRules = require('../recommended-rules-gts');
3+
4+
module.exports = {
5+
...base,
6+
rules: gtsRules,
7+
};

lib/config-legacy/recommended.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const base = require('./base');
2+
const rules = require('../recommended-rules');
3+
4+
module.exports = {
5+
...base,
6+
rules,
7+
};

lib/config/base.js

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,17 @@
1-
module.exports = {
2-
root: true,
1+
const plugin = require('../index');
32

4-
parserOptions: {
5-
ecmaVersion: 2022,
6-
sourceType: 'module',
3+
module.exports = [
4+
{
5+
plugins: { ember: plugin },
76
},
87

9-
env: {
10-
browser: true,
11-
es2022: true,
8+
/**
9+
* We don't want to *always* have the preprocessor active,
10+
* it's only relevant on gjs and gts files to detect if eslint config is correctly setup for this files.
11+
*/
12+
{
13+
files: ['**/*.{gts,gjs}'],
14+
parser: 'eslint-plugin-ember/gjs-gts-parser',
15+
processor: 'ember/<noop>',
1216
},
13-
14-
plugins: ['ember'],
15-
16-
overrides: [
17-
/**
18-
* We don't want to *always* have the preprocessor active,
19-
* it's only relevant on gjs and gts files to detect if eslint config is correctly setup for this files.
20-
*/
21-
{
22-
files: ['**/*.{gts,gjs}'],
23-
parser: 'eslint-plugin-ember/gjs-gts-parser',
24-
processor: 'ember/<noop>',
25-
},
26-
],
27-
};
17+
];

lib/config/recommended-gjs.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
const base = require('./base');
22
const gjsRules = require('../recommended-rules-gjs');
33

4-
module.exports = {
5-
...base,
6-
rules: gjsRules,
7-
};
4+
module.exports = [...base, { rules: gjsRules }];

lib/config/recommended-gts.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
const base = require('./base');
22
const gtsRules = require('../recommended-rules-gts');
33

4-
module.exports = {
5-
...base,
6-
rules: gtsRules,
7-
};
4+
module.exports = [...base, { rules: gtsRules }];

0 commit comments

Comments
 (0)