@open-xchange/linter-presets 0.1.0 → 0.1.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.1] - 2024-07-11
4
+
5
+ - changed: [ESLint] changed stylistic option "semi" to enum (always/never/off)
6
+
3
7
  ## [0.1.0] - 2024-07-10
4
8
 
5
9
  - chore: converted source code to TypeScript
package/README.md CHANGED
@@ -38,7 +38,7 @@ Usage example:
38
38
  // stylelint.config.js
39
39
  import { stylelint } from "@open-xchange/linter-presets"
40
40
 
41
- export default eslint.configure({
41
+ export default stylelint.configure({
42
42
  /* config options */
43
43
  })
44
44
  ```
@@ -78,7 +78,7 @@ export default function stylistic(options) {
78
78
  "@stylistic/quote-props": ["error", "as-needed"],
79
79
  "@stylistic/quotes": (quotes === "off") ? "off" : ["error", quotes, { avoidEscape: true }],
80
80
  "@stylistic/rest-spread-spacing": "error",
81
- "@stylistic/semi": ["error", semi ? "always" : "never"],
81
+ "@stylistic/semi": (semi === "off") ? "off" : ["error", semi],
82
82
  "@stylistic/semi-spacing": "error",
83
83
  "@stylistic/semi-style": "error",
84
84
  "@stylistic/space-before-blocks": "error",
@@ -54,7 +54,7 @@ export function configure(options) {
54
54
  // resolve stylistic configuration options
55
55
  const stylisticOptions = {
56
56
  indent: 2,
57
- semi: false,
57
+ semi: "never",
58
58
  quotes: "single",
59
59
  dangle: "always",
60
60
  ...options?.stylistic,
@@ -29,10 +29,15 @@ export interface StylisticOptions {
29
29
  */
30
30
  indent?: number;
31
31
  /**
32
- * Specifies whether to require semicolons following all statements. By
33
- * default, semicolons must be omitted if possible according to ASI rules.
32
+ * Specifies how to treat semicolons.
33
+ *
34
+ * - "always": Require semicolons following all statements.
35
+ * - "never": Require to omit semicolons according to ASI rules.
36
+ * - "off": Semicolons will not be checked.
37
+ *
38
+ * Default value is "never".
34
39
  */
35
- semi?: boolean;
40
+ semi?: "always" | "never" | "off";
36
41
  /**
37
42
  * The type of the string delimiter character. Default value is "single".
38
43
  */
@@ -57,7 +57,7 @@ export default [
57
57
  ignores: ["dist/*", "external/**/*.yaml"],
58
58
  language: { ecmaVersion: 2024, sourceType: "commonjs" },
59
59
  license: resolve("./license.txt"),
60
- stylistic: { quotes: "double", semi: true },
60
+ stylistic: { quotes: "double", semi: "always" },
61
61
  }),
62
62
  ]
63
63
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-xchange/linter-presets",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Configuration presets for ESLint and StyleLint",
5
5
  "repository": {
6
6
  "url": "https://gitlab.open-xchange.com/fspd/npm-packages/linter-presets"