@discourse/lint-configs 2.3.1 → 2.5.0

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.
package/README.md CHANGED
@@ -6,16 +6,18 @@ Shareable lint configs for Discourse core, plugins, and themes
6
6
 
7
7
  Add `@discourse/lint-configs` to package.json, and create these three files:
8
8
 
9
- ### .eslintrc.cjs
9
+ ### eslint.config.mjs
10
10
 
11
11
  ```js
12
- module.exports = require("@discourse/lint-configs/eslint");
12
+ import DiscourseRecommended from "@discourse/lint-configs/eslint";
13
+ export default [...DiscourseRecommended];
13
14
  ```
14
15
 
15
16
  or in themes/theme components:
16
17
 
17
18
  ```js
18
- module.exports = require("@discourse/lint-configs/eslint-theme");
19
+ import DiscourseThemeRecommended from "@discourse/lint-configs/eslint-theme";
20
+ export default [...DiscourseThemeRecommended];
19
21
  ```
20
22
 
21
23
  ### .prettierrc.cjs
@@ -24,6 +26,14 @@ module.exports = require("@discourse/lint-configs/eslint-theme");
24
26
  module.exports = require("@discourse/lint-configs/prettier");
25
27
  ```
26
28
 
29
+ ### stylelint.config.mjs
30
+
31
+ ```js
32
+ export default {
33
+ extends: ["@discourse/lint-configs/stylelint"],
34
+ };
35
+ ```
36
+
27
37
  ### .template-lintrc.cjs
28
38
 
29
39
  ```js
package/eslint.mjs CHANGED
@@ -284,15 +284,12 @@ export default [
284
284
  ],
285
285
  },
286
286
  ],
287
- // TODO: enable by default once this commit is available widely
288
- // https://github.com/discourse/discourse/commit/d606ac3d8e
289
- // "discourse/i18n-import-location": ["error"],
290
- // "discourse/i18n-t": ["error"],
287
+ "discourse/i18n-import-location": ["error"],
288
+ "discourse/i18n-t": ["error"],
291
289
  "discourse/service-inject-import": ["error"],
292
290
  "discourse/no-simple-queryselector": ["error"],
293
291
  "discourse/deprecated-lookups": ["error"],
294
- // TODO: enable by default once 98fa42f2 is widely available
295
- // "discourse/discourse-common-imports": ["error"],
292
+ "discourse/discourse-common-imports": ["error"],
296
293
  },
297
294
  },
298
295
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@discourse/lint-configs",
3
- "version": "2.3.1",
3
+ "version": "2.5.0",
4
4
  "description": "Shareable lint configs for Discourse core, plugins, and themes",
5
5
  "author": "Discourse",
6
6
  "license": "MIT",
@@ -19,6 +19,7 @@
19
19
  "./prettier": {
20
20
  "require": "./.prettierrc.cjs"
21
21
  },
22
+ "./stylelint": "./stylelint.mjs",
22
23
  "./template-lint": {
23
24
  "require": "./template-lint.config.cjs"
24
25
  },
@@ -29,25 +30,29 @@
29
30
  "test": "cd ../test && node test.js"
30
31
  },
31
32
  "dependencies": {
32
- "@babel/core": "^7.26.7",
33
- "@babel/eslint-parser": "^7.26.5",
33
+ "@babel/core": "^7.26.9",
34
+ "@babel/eslint-parser": "^7.26.8",
34
35
  "@babel/plugin-proposal-decorators": "^7.25.9",
35
- "@stylistic/eslint-plugin-js": "^3.0.1",
36
+ "@stylistic/eslint-plugin-js": "^4.0.1",
36
37
  "ember-template-lint": "^6.1.0",
37
- "eslint": "^9.19.0",
38
+ "eslint": "^9.20.1",
38
39
  "eslint-plugin-decorator-position": "^6.0.0",
39
- "eslint-plugin-ember": "^12.3.3",
40
+ "eslint-plugin-ember": "^12.5.0",
40
41
  "eslint-plugin-qunit": "^8.1.2",
41
42
  "eslint-plugin-simple-import-sort": "^12.1.1",
42
43
  "eslint-plugin-sort-class-members": "^1.21.0",
43
- "globals": "^15.14.0",
44
+ "globals": "^15.15.0",
44
45
  "prettier": "^2.8.8",
45
46
  "prettier-plugin-ember-template-tag": "^0.3.2",
47
+ "stylelint": "^16.14.1",
48
+ "stylelint-config-standard": "^37.0.0",
49
+ "stylelint-config-standard-scss": "^14.0.0",
46
50
  "typescript": "^5.7.3"
47
51
  },
48
52
  "peerDependencies": {
49
53
  "ember-template-lint": "6.1.0",
50
- "eslint": "9.19.0",
51
- "prettier": "2.8.8"
54
+ "eslint": "9.20.1",
55
+ "prettier": "2.8.8",
56
+ "stylelint": "16.14.1"
52
57
  }
53
58
  }
package/stylelint.mjs ADDED
@@ -0,0 +1,42 @@
1
+ export default {
2
+ extends: ["stylelint-config-standard-scss"],
3
+ rules: {
4
+ "color-no-invalid-hex": true,
5
+ "unit-no-unknown": true,
6
+ "at-rule-empty-line-before": null,
7
+ "rule-empty-line-before": [
8
+ "always",
9
+ { except: ["after-single-line-comment", "first-nested"] },
10
+ ],
11
+ "selector-class-pattern": null,
12
+ "custom-property-pattern": null,
13
+ "declaration-empty-line-before": "never",
14
+ "alpha-value-notation": null,
15
+ "color-function-notation": null,
16
+ "shorthand-property-no-redundant-values": null,
17
+ "declaration-block-no-redundant-longhand-properties": null,
18
+ "no-descending-specificity": null,
19
+ "keyframes-name-pattern": null,
20
+ "scss/dollar-variable-pattern": null,
21
+ "number-max-precision": null,
22
+ "scss/at-extend-no-missing-placeholder": null,
23
+ "scss/load-no-partial-leading-underscore": null,
24
+ "scss/operator-no-newline-after": null,
25
+ "selector-id-pattern": null,
26
+ "no-invalid-position-at-import-rule": null,
27
+ "scss/at-function-pattern": null,
28
+ "scss/comment-no-empty": null,
29
+ "scss/at-mixin-pattern": null,
30
+ "media-feature-range-notation": "prefix",
31
+ "property-no-vendor-prefix": [
32
+ true,
33
+ {
34
+ ignoreProperties: [
35
+ "backdrop-filter",
36
+ "text-size-adjust",
37
+ "user-select",
38
+ ],
39
+ },
40
+ ],
41
+ },
42
+ };