You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`--class-fields`| boolean |`true`| Enable/disable transformation using class fields |
31
-
|`--decorators`| boolean |`true`| Enable/disable transformation using decorators |
32
-
|`--classic-decorator`| boolean |`true`| Enable/disable adding the [`@classic` decorator](https://github.com/pzuraq/ember-classic-decorator), which helps with transitioning Ember Octane |
33
-
|`--type`| String | Empty (match all types in path) | Apply transformation to only passed type. The type can be one of `services`, `routes`, `components`, `controllers`|
34
-
|`--quote`| String |`'single'`| Whether to use double or single quotes by default for new statements that are added during the codemod. |
26
+
### Options
27
+
28
+
The codemod accepts the following options, passed as CLI arguments, set in a `.codemods.{json,js,cjs,yml}` file, or set in a `"codemods"` object in `package.json`.
|`--class-fields` / `classFields`|`boolean`|`true`| Enable/disable transformation using class fields |
33
+
|`--decorators` / `decorators`|`boolean \| DecoratorsConfig`|`true`| Set to `false` to disable transformation using decorators. Set to `DecoratorsConfig` object (see below) to pass additional decorator options. |
34
+
|`--classic-decorator` / `classicDecorator`|`boolean`|`true`| Enable/disable adding the [`@classic` decorator](https://github.com/pzuraq/ember-classic-decorator), which helps with transitioning Ember Octane |
35
+
|`--type` / `type`|`'services' \| 'routes' \| 'components' \| 'controllers' \| undefined`' |`undefined`| Apply transformation to only passed type. If `undefined, will match all types in path. |
36
+
|`--quote` / `quote`|`'single' \| 'double'`|`'single'`| Whether to use double or single quotes by default for new statements that are added during the codemod. |
37
+
|`--partial-transforms` / `partialTransforms`|`boolean`|`true`| If `false`, the entire file will fail validation if any EmberObject within it fails validation. |
38
+
|`--ignore-leaking-state` / `ignoreLeakingState`|`string[]`|`['queryParams']`| Allow-list for `ObjectExpression` or `ArrayExpression` properties to ignore issues detailed in [eslint-plugin-ember/avoid-leaking-state-in-ember-objects](https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/avoid-leaking-state-in-ember-objects.md). In the classic class syntax, using arrays and objects as default properties causes their state to "leak" between instances. If you have custom properties where you know that the shared state won't be a problem (for example, read-only configuration values), you can use this config to ignore them. NOTE: Passing this option will override the defaults, so ensure you include `'queryParams'` in the list unless you explicitly wish to disallow it. |
39
+
|`DecoratorsConfig`| An object with the following properties. | See below. | Allow-list for decorators currently applied to object literal properties that can be safely applied to class properties. Pass as a comma-separated string if using as a CLI-option. Otherwise pass as an array of strings. |
40
+
|`DecoratorsConfig.inObjectLiterals`|`string \| string[]`|`[]`| Allow-list for decorators currently applied to object literal properties that can be safely applied to class properties. Pass as a comma-separated string if using as a CLI-option. Otherwise pass as an array of strings. NOTE: Decorators on object methods will be allowed by default. |
0 commit comments