@heyq02/rslint-config 0.0.3-beta.1 → 0.0.4

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
@@ -1,9 +1,10 @@
1
1
  # @heyq02/rslint-config
2
2
 
3
- <!-- automd:badges license -->
3
+ <!-- automd:badges license codecov -->
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@heyq02/rslint-config)](https://npmjs.com/package/@heyq02/rslint-config)
6
6
  [![npm downloads](https://img.shields.io/npm/dm/@heyq02/rslint-config)](https://npm.chart.dev/@heyq02/rslint-config)
7
+ [![codecov](https://img.shields.io/codecov/c/gh/heyq02/rslint-config)](https://codecov.io/gh/heyq02/rslint-config)
7
8
  [![license](https://img.shields.io/github/license/heyq02/rslint-config)](https://github.com/heyq02/rslint-config/blob/main/LICENSE)
8
9
 
9
10
  <!-- /automd -->
@@ -75,6 +76,7 @@ export default heyq02(
75
76
  | `regexp` | `true` | `eslint-plugin-regexp` |
76
77
  | `deMorgan` | `true` | `eslint-plugin-de-morgan` |
77
78
  | `eslintComments` | `true` | `@eslint-community/eslint-plugin-eslint-comments` |
79
+ | `isInEditor` | auto | Soften unused-import rules in VS Code / JetBrains / Vim |
78
80
  | `ignores` | `[]` | Extra global ignore patterns |
79
81
 
80
82
  ### Sort imports
@@ -130,6 +132,8 @@ export default presetBasic();
130
132
 
131
133
  ## Development
132
134
 
135
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) for setup, scripts, and PR expectations.
136
+
133
137
  ```bash
134
138
  pnpm install
135
139
  pnpm run build
@@ -137,9 +141,11 @@ pnpm run lint
137
141
  pnpm run typecheck
138
142
  pnpm run format # automd + vp fmt (Oxfmt via Vite+)
139
143
  pnpm run check # format:check + rslint + tsc
140
- pnpm release # bumpp → tag v* → GitHub Release + npm publish
144
+ pnpm release # changelogen: bump + CHANGELOG.md + tag (then push)
141
145
  ```
142
146
 
147
+ Release notes live in [CHANGELOG.md](./CHANGELOG.md). Pushing a `v*` tag runs CI (`changelogithub` + npm publish). Sync existing tags with `pnpm run changelog:sync`.
148
+
143
149
  ## License
144
150
 
145
151
  <!-- automd:contributors license=MIT author="heyq02" -->
@@ -1,5 +1,12 @@
1
1
  import type { TypedFlatConfig } from '../types.js';
2
+ export interface UnusedImportsOptions {
3
+ /**
4
+ * When true, unused-import rules are disabled so the editor stays quiet while typing.
5
+ * @default false
6
+ */
7
+ isInEditor?: boolean;
8
+ }
2
9
  /**
3
10
  * Autofix unused imports via `eslint-plugin-unused-imports` (Rslint community plugin).
4
11
  */
5
- export declare const unusedImports: () => TypedFlatConfig[];
12
+ export declare const unusedImports: (options?: UnusedImportsOptions) => TypedFlatConfig[];
package/dist/index.js CHANGED
@@ -745,7 +745,9 @@ const unusedVarsOptions = {
745
745
  ignoreRestSiblings: true,
746
746
  varsIgnorePattern: '^_'
747
747
  };
748
- const unusedImports = ()=>[
748
+ const unusedImports = (options = {})=>{
749
+ const { isInEditor = false } = options;
750
+ return [
749
751
  {
750
752
  files: [
751
753
  GLOB_SRC
@@ -757,8 +759,8 @@ const unusedImports = ()=>[
757
759
  rules: {
758
760
  'no-unused-vars': 'off',
759
761
  "@typescript-eslint/no-unused-vars": 'off',
760
- 'unused-imports/no-unused-imports': 'error',
761
- 'unused-imports/no-unused-vars': [
762
+ 'unused-imports/no-unused-imports': isInEditor ? 'off' : 'error',
763
+ 'unused-imports/no-unused-vars': isInEditor ? 'off' : [
762
764
  'error',
763
765
  {
764
766
  ...unusedVarsOptions
@@ -767,6 +769,7 @@ const unusedImports = ()=>[
767
769
  }
768
770
  }
769
771
  ];
772
+ };
770
773
  const hasTypeScript = ()=>isPackageExists("typescript");
771
774
  const hasReact = ()=>isPackageExists('react') || isPackageExists('react-dom') || isPackageExists('next') || isPackageExists('preact') || isPackageExists('@remix-run/react');
772
775
  const hasJest = ()=>isPackageExists('jest') || isPackageExists('@jest/globals');
@@ -805,7 +808,9 @@ const presetJavaScript = ()=>[
805
808
  ...unicorn(),
806
809
  ...node(),
807
810
  ...promise(),
808
- ...unusedImports(),
811
+ ...unusedImports({
812
+ isInEditor: isInEditorEnv()
813
+ }),
809
814
  ...regexp(),
810
815
  ...deMorgan(),
811
816
  ...eslintComments()
@@ -821,7 +826,9 @@ const presetBasic = (typescriptOptions = true)=>[
821
826
  ...unicorn(),
822
827
  ...node(),
823
828
  ...promise(),
824
- ...unusedImports(),
829
+ ...unusedImports({
830
+ isInEditor: isInEditorEnv()
831
+ }),
825
832
  ...regexp(),
826
833
  ...deMorgan(),
827
834
  ...eslintComments()
@@ -834,7 +841,7 @@ const presetAll = ()=>heyq02({
834
841
  jsxA11y: true
835
842
  });
836
843
  function heyq02(options = {}, ...userConfigs) {
837
- const { ignores: extraIgnores = [], javascript: enableJavaScript = true, typescript: enableTypeScript = hasTypeScript(), unicorn: enableUnicorn = true, imports: enableImports = true, sortImports: sortImportsOption = true, node: enableNode = true, promise: enablePromise = true, react: enableReact = hasReact(), jsxA11y: enableJsxA11y, jest: enableJest = hasJest(), rstest: enableRstest = hasRstest(), unusedImports: enableUnusedImports = true, regexp: enableRegexp = true, deMorgan: enableDeMorgan = true, eslintComments: enableEslintComments = true } = options;
844
+ const { ignores: extraIgnores = [], isInEditor = isInEditorEnv(), javascript: enableJavaScript = true, typescript: enableTypeScript = hasTypeScript(), unicorn: enableUnicorn = true, imports: enableImports = true, sortImports: sortImportsOption = true, node: enableNode = true, promise: enablePromise = true, react: enableReact = hasReact(), jsxA11y: enableJsxA11y, jest: enableJest = hasJest(), rstest: enableRstest = hasRstest(), unusedImports: enableUnusedImports = true, regexp: enableRegexp = true, deMorgan: enableDeMorgan = true, eslintComments: enableEslintComments = true } = options;
838
845
  const configs = [
839
846
  ...ignores(extraIgnores)
840
847
  ];
@@ -853,7 +860,9 @@ function heyq02(options = {}, ...userConfigs) {
853
860
  else if (enableJsxA11y) configs.push(...jsxA11y());
854
861
  if (enableJest) configs.push(...jest());
855
862
  if (enableRstest) configs.push(...rstest());
856
- if (enableUnusedImports) configs.push(...unusedImports());
863
+ if (enableUnusedImports) configs.push(...unusedImports({
864
+ isInEditor
865
+ }));
857
866
  if (enableRegexp) configs.push(...regexp());
858
867
  if (enableDeMorgan) configs.push(...deMorgan());
859
868
  if (enableEslintComments) configs.push(...eslintComments());
package/dist/types.d.ts CHANGED
@@ -117,6 +117,12 @@ export interface Options {
117
117
  * Global ignore patterns. Merged with the built-in excludes.
118
118
  */
119
119
  ignores?: string[];
120
+ /**
121
+ * Treat the process as an editor (VS Code / JetBrains / Vim).
122
+ * When unset, auto-detected from editor environment variables.
123
+ * In editor mode, unused-import rules are softened to reduce noise while typing.
124
+ */
125
+ isInEditor?: boolean;
120
126
  /**
121
127
  * JavaScript support. @default true
122
128
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heyq02/rslint-config",
3
- "version": "0.0.3-beta.1",
3
+ "version": "0.0.4",
4
4
  "description": "Opinionated Rslint flat-config preset.",
5
5
  "keywords": [
6
6
  "flat-config",
@@ -44,12 +44,13 @@
44
44
  },
45
45
  "devDependencies": {
46
46
  "@arethetypeswrong/cli": "^0.18.5",
47
- "@heyq02/rslib-config": "^1.0.1",
47
+ "@heyq02/rslib-config": "^1.0.2",
48
48
  "@rslib/core": "^1.0.3",
49
49
  "@rslint/core": "^0.9.4",
50
50
  "@types/node": "^26.1.1",
51
+ "@vitest/coverage-v8": "^5.0.3",
51
52
  "automd": "^0.4.3",
52
- "bumpp": "^11.1.0",
53
+ "changelogen": "^0.6.2",
53
54
  "publint": "^0.3.25",
54
55
  "typescript": "^7.0.2",
55
56
  "vite-plus": "^1.1.0"
@@ -71,6 +72,7 @@
71
72
  "build": "rslib",
72
73
  "dev": "rslib --watch",
73
74
  "test": "vp test",
75
+ "test:coverage": "vp test --coverage",
74
76
  "lint": "rslint .",
75
77
  "lint:fix": "rslint --fix .",
76
78
  "automd": "automd",
@@ -81,6 +83,8 @@
81
83
  "publint": "publint",
82
84
  "attw": "pnpm pack && attw heyq02-rslint-config-*.tgz --profile esm-only && rm -f heyq02-rslint-config-*.tgz",
83
85
  "check:package": "pnpm run build && pnpm run publint && pnpm run attw",
84
- "release": "bumpp"
86
+ "changelog": "changelogen",
87
+ "changelog:sync": "changelogen gh release all",
88
+ "release": "changelogen --release --no-github"
85
89
  }
86
90
  }