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
Copy file name to clipboardExpand all lines: README.md
+51-1Lines changed: 51 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,4 +34,54 @@ Stencil components are just Web Components, so they work in any major framework
34
34
Stay tuned - coming soon.
35
35
36
36
## Usage (Individual Components)
37
-
Usage of each component is documented within the component folder right here on GitHub, along with some code samples too.
37
+
Usage of each component is documented within the library `components` folder along with code samples.
38
+
39
+
## Usage (`eslint-plugin`)
40
+
To help better handle breaking changes, and to provide advice regarding usage, a custom `eslint` plugin is included in this package. Some breaking changes have auto-fixes. Until we release v1.0.0, it is advisable to upgrade one minor version at a time, and if you use `eslint` or `tslint`, you can get some of the fixes applied automatically for you. We currently only support the flat config format, so you will need those set up:
41
+
-`eslint` v8 (with the option to use the flat config type)
42
+
-`eslint` v9 (flat config is already mandatory)
43
+
-`typescript-eslint` (flat config is already mandatory) **recommended if you use typescript**
44
+
45
+
No additional package is needed. Just use the already installed `@dnncommunity/dnn-elements` and import the `eslint-plugin`. Then use it in your config:
46
+
47
+
```diff
48
+
import tseslint from 'typescript-eslint';
49
+
import eslint from '@eslint/js';
50
+
+import dnnelements from '@dnncommunity/dnn-elements/eslint-plugin';
51
+
52
+
export default tseslint.config(
53
+
tseslint.configs.recommendedTypeChecked,
54
+
stencil.configs.flat.recommended,
55
+
+ dnnelements.configs.flat.recommended,
56
+
{
57
+
files: [
58
+
"src/**/*.{ts,tsx}",
59
+
],
60
+
},
61
+
{
62
+
ignores: [
63
+
"dist/",
64
+
"www/",
65
+
],
66
+
},
67
+
{
68
+
languageOptions: {
69
+
ecmaVersion: "latest",
70
+
sourceType: "module",
71
+
parserOptions: {
72
+
projectService: true,
73
+
project: './tsconfig.json',
74
+
}
75
+
}
76
+
},
77
+
)
78
+
```
79
+
80
+
## Upgrading
81
+
As we worked towards a `v1.x.x` release, we had several unavoidable breaking changes to handle along the way. The above `eslint` setup is highly recommended to help you with auto-fixes to handle those breaking changes smoothly, even with hundreds of usages. This means you need to follow a known upgrade path.
82
+
83
+
- From `<v0.24.0` you should upgrade directly to `v0.24.4` and handle all the breaking changes (ideally using `eslint --fix`).
84
+
- From `v0.24.4` - `v0.25.1` you should upgrade to `v0.26.0` and check manually if you used any of the removed CSS variables to adjust accordingly (see https://github.com/DNNCommunity/dnn-elements/pull/1252/files to spot the removals). Since this is CSS, there are no `eslint` rules to help you there.
85
+
- From `v0.26.0` onwards, you should upgrade to `v0.27.1` and handle all deprecations.
86
+
- From `v0.27.1 - v1.x.x` we will add auto-fixes at each latest minor release.
87
+
- From `v1.x.x` we will use semantic versioning, and you can simply upgrade one major version at a time. They will include auto-fixes in the same release where breaking changes happen.
0 commit comments