@letstri/oxc-config 0.7.0 → 0.7.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/dist/cli.mjs +7 -29
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -25,33 +25,7 @@ const vscodeSettings = {
25
25
  "editor.codeActionsOnSave": { "source.organizeImports": "never" }
26
26
  };
27
27
  const oxfmtFormatter = { language_server: { name: "oxfmt" } };
28
- function formatOnSave(withFix = false) {
29
- return {
30
- format_on_save: "on",
31
- prettier: { allowed: false },
32
- formatter: withFix ? [oxfmtFormatter, { code_action: "source.fixAll.oxc" }] : [oxfmtFormatter]
33
- };
34
- }
35
- const cssLike = [
36
- "CSS",
37
- "GraphQL",
38
- "Handlebars",
39
- "HTML",
40
- "JSON",
41
- "JSON5",
42
- "JSONC",
43
- "Less",
44
- "Markdown",
45
- "MDX",
46
- "SCSS",
47
- "YAML"
48
- ];
49
- const codeLike = [
50
- "JavaScript",
51
- "TypeScript",
52
- "TSX",
53
- "Vue.js"
54
- ];
28
+ const codeFormatter = [oxfmtFormatter, { code_action: "source.fixAll.oxc" }];
55
29
  const zedSettings = {
56
30
  lsp: {
57
31
  oxlint: { initialization_options: { settings: {
@@ -66,9 +40,13 @@ const zedSettings = {
66
40
  "run": "onSave"
67
41
  } } }
68
42
  },
43
+ format_on_save: "on",
44
+ prettier: { allowed: false },
45
+ formatter: [oxfmtFormatter],
69
46
  languages: {
70
- ...Object.fromEntries(cssLike.map((lang) => [lang, formatOnSave()])),
71
- ...Object.fromEntries(codeLike.map((lang) => [lang, formatOnSave(true)]))
47
+ JavaScript: { formatter: codeFormatter },
48
+ TypeScript: { formatter: codeFormatter },
49
+ TSX: { formatter: codeFormatter }
72
50
  }
73
51
  };
74
52
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letstri/oxc-config",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Opinionated Oxlint and Oxfmt configs",
5
5
  "homepage": "https://github.com/letstri/oxc-config#readme",
6
6
  "bugs": {