@enke.dev/lint 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +27 -21
  2. package/package.json +6 -3
package/README.md CHANGED
@@ -2,13 +2,19 @@
2
2
 
3
3
  ## Install packages
4
4
 
5
- Make sure to install the necessary peer dependencies `eslint`, `prettier` and `typescript`.
5
+ Make sure to install the necessary peer dependencies:
6
6
 
7
7
  ```bash
8
- npm i -D @enke.dev/lint eslint prettier typescript
8
+ npm i -D @enke.dev/lint eslint prettier
9
9
  ```
10
10
 
11
- ## Prepare config
11
+ For Typescript support, install:
12
+
13
+ ```bash
14
+ npm i -D @enke.dev/lint eslint prettier jiti typescript typescript-eslint
15
+ ```
16
+
17
+ ## Prepare Eslint config
12
18
 
13
19
  Create a `eslint.config.js` file in the root of your project and add the following content:
14
20
 
@@ -18,24 +24,26 @@ import config from '@enke.dev/lint';
18
24
  export default config;
19
25
  ```
20
26
 
21
- ## Using Typescript
27
+ ### Using Typescript
22
28
 
23
- If you intend to use Typescript for your config file, you just have to install `typescript`.
29
+ If you intend to use Typescript for your config file, you just have to install `typescript` and `jiti`.
24
30
 
25
- Your config file can then renamed to `eslint.config.ts` and look like this at minimum:
31
+ Your config file can then be renamed to `eslint.config.ts` and look like this at minimum:
26
32
 
27
33
  ```ts
28
34
  import config from '@enke.dev/lint';
35
+
29
36
  export default config;
30
37
  ```
31
38
 
32
- But you may want to modify the config to your needs:
39
+ You may want to modify the config to your needs, e.g. like this:
33
40
 
34
41
  ```ts
35
42
  import config from '@enke.dev/lint';
36
- import type { Linter } from 'eslint';
43
+ import { defineConfig } from 'eslint/config';
37
44
 
38
- export default [
45
+ export default defineConfig([
46
+ // extend the base config
39
47
  ...config,
40
48
  // ignore generated stuff
41
49
  { ignores: ['src/generated'] },
@@ -46,30 +54,28 @@ export default [
46
54
  '@typescript-eslint/no-unused-expressions': ['off'],
47
55
  },
48
56
  },
49
- ] satisfies Linter.Config[];
57
+ ]);
50
58
  ```
51
59
 
52
- > Until eslint 9.18.0 some hacks have been necessary to make this work.
53
- > If your stuck to an older version, you can use a [release prior 0.3.0](https://www.npmjs.com/package/@enke/lint/v/0.2.2).
54
-
55
- ## Using monorepos
60
+ ### Using Monorepos
56
61
 
57
- Like the experimental typescript config flag above, the VSCode Eslint plugin can be configured to pick up the packages correctly by setting:
62
+ The VSCode Eslint plugin can be configured to pick up packages correctly by updating your `settings.json`, e.g.:
58
63
 
59
64
  ```json
60
65
  {
61
- "eslint.workingDirectories": ["./packages/foo", "./packages/bar"]
66
+ "eslint.workingDirectories": ["./packages/*"]
62
67
  }
63
68
  ```
64
69
 
65
- ## Stylelint (experimental)
70
+ ## Prepare Stylelint config (experimental)
66
71
 
67
- Using a shared Stylelint config with two major presets, `stylelint-config-standard-scss` and `stylelint-config-rational-order`.
72
+ Uses some common presets and can be used in CSS, SASS and SCSS files.\
73
+ It will enforce a specific property order and specific custom property prefixes if configured.
68
74
 
69
- As this is totally opt-in, all required dependencies must be installed:
75
+ As this is totally opt-in, all necessary dependencies must be installed first:
70
76
 
71
77
  ```bash
72
- npm i -D stylelint stylelint-config-rational-order stylelint-config-standard-scss stylelint-order
78
+ npm i -D @enke.dev/lint stylelint stylelint-config-rational-order stylelint-config-standard-scss stylelint-order
73
79
  ```
74
80
 
75
81
  Create a `stylelint.config.js` file in the root of your project and add the following content:
@@ -82,4 +88,4 @@ import { defineConfig } from '@enke.dev/lint/stylelint.config.js';
82
88
  export default defineConfig({ cssCustomPropertyPrefix: 'your-prefix' });
83
89
  ```
84
90
 
85
- For now, no TypeScript support is included.
91
+ For now, [no TypeScript support](https://github.com/stylelint/stylelint/issues/4940) is possible.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enke.dev/lint",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Meta package to provide linting for web projects",
5
5
  "homepage": "https://github.com/enke-dev/lint",
6
6
  "repository": {
@@ -37,13 +37,17 @@
37
37
  "prettier": "^3.6.2"
38
38
  },
39
39
  "optionalDependencies": {
40
+ "jiti": "^2.5.1",
40
41
  "stylelint": "^16.24.0",
41
42
  "stylelint-config-rational-order": "^0.1.2",
42
43
  "stylelint-config-standard-scss": "^16.0.0",
43
- "stylelint-order": "^7.0.0"
44
+ "stylelint-order": "^7.0.0",
45
+ "typescript": "^5.9.2",
46
+ "typescript-eslint": "^8.43.0"
44
47
  },
45
48
  "dependencies": {
46
49
  "@eslint/compat": "^1.3.2",
50
+ "@eslint/js": "^9.35.0",
47
51
  "@eslint/json": "^0.13.2",
48
52
  "eslint-config-prettier": "^10.1.8",
49
53
  "eslint-import-resolver-typescript": "^4.4.4",
@@ -60,7 +64,6 @@
60
64
  },
61
65
  "devDependencies": {
62
66
  "@eslint/config-inspector": "1.2.0",
63
- "@eslint/js": "9.35.0",
64
67
  "@types/node": "24.3.1",
65
68
  "eslint": "9.35.0",
66
69
  "jiti": "2.5.1",