@component-hook/eslint-plugin 0.1.2-alpha.4 → 0.1.2

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,13 +1,12 @@
1
1
  # @component-hook/eslint-plugin
2
2
 
3
- A opinionated ESLint config preset for JavaScript, TypeScript, Vue,
4
- and Prettier.
3
+ A opinionated ESLint config preset for JavaScript, TypeScript, Vue, and Prettier.
5
4
 
6
5
  <p>
7
- <a href="https://npm-stat.com/charts.html?package=@component-hook/picker">
6
+ <a href="https://npm-stat.com/charts.html?package=@component-hook/eslint-plugin">
8
7
  <img src="https://img.shields.io/npm/dm/@component-hook/eslint-plugin.svg" alt="npm"/>
9
8
  </a>
10
- <a href="https://www.npmjs.com/package/@component-hook/picker">
9
+ <a href="https://www.npmjs.com/package/@component-hook/eslint-plugin">
11
10
  <img src="https://img.shields.io/npm/v/@component-hook/eslint-plugin.svg" alt="npm"/>
12
11
  </a>
13
12
  </p>
@@ -63,11 +62,11 @@ See [basic](./index.ts) and [ignores](./configs/ignores.ts) for more details.
63
62
 
64
63
  ```js
65
64
  import {
66
- reactRecommended, // Includes basic, react, markdown, sonarjs, security configs
67
- vueRecommended, // Includes basic, vue, markdown, sonarjs, security configs
65
+ reactPreset, // Includes basic, react, markdown, sonarjs, security configs
66
+ vuePreset, // Includes basic, vue, markdown, sonarjs, security configs
68
67
  } from '@component-hook/eslint-plugin';
69
68
 
70
- export default reactRecommended;
69
+ export default reactPreset;
71
70
  ```
72
71
 
73
72
  ## Configs
@@ -75,7 +74,7 @@ export default reactRecommended;
75
74
  | Name | Type | Reference |
76
75
  | ----------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------- |
77
76
  | basic | `Linter.Config[]` | `eslint-recommended`, `typescript-eslint`, `eslint-plugin-import`, `eslint-plugin-regexp` and `eslint-plugin-prettier` |
78
- | vue | `Linter.Config[]` | `eslint-plugin-vue` |
77
+ | vue | `Linter.Config[]` | `eslint-plugin-vue`, `typescript-eslint` |
79
78
  | react | `Linter.Config[]` | `eslint-plugin-react/recommended`, `eslint-plugin-react-hooks/recommended`, `eslint-plugin-jsx-a11y/recommended` |
80
79
  | markdown | `Linter.Config[]` | `eslint-plugin-markdown/recommended` |
81
80
  | sonarjs | `Linter.Config` | `eslint-plugin-sonarjs/recommended` |
package/dist/index.d.ts CHANGED
@@ -1172,7 +1172,7 @@ declare const _default: {
1172
1172
  };
1173
1173
  };
1174
1174
 
1175
- declare const reactRecommended: ({
1175
+ declare const reactPreset: ({
1176
1176
  name: string;
1177
1177
  rules: {
1178
1178
  'no-var': string;
@@ -2328,7 +2328,7 @@ declare const reactRecommended: ({
2328
2328
  };
2329
2329
  };
2330
2330
  })[];
2331
- declare const vueRecommended: ({
2331
+ declare const vuePreset: ({
2332
2332
  name: string;
2333
2333
  rules: {
2334
2334
  'no-var': string;
@@ -4648,4 +4648,4 @@ declare const vueSkyline: ({
4648
4648
  };
4649
4649
  })[];
4650
4650
 
4651
- export { _default as default, reactRecommended, vueRecommended, vueSkyline };
4651
+ export { _default as default, reactPreset, vuePreset, vueSkyline };
package/dist/index.js CHANGED
@@ -363,12 +363,19 @@ var jsConfigs = [
363
363
 
364
364
  // configs/typescript.ts
365
365
  var rules2 = {
366
- "@typescript-eslint/no-unused-expressions": "off",
367
366
  "@typescript-eslint/ban-ts-comment": "off",
368
367
  "@typescript-eslint/no-explicit-any": "off",
369
368
  "@typescript-eslint/no-unsafe-function-type": "off",
370
369
  "@typescript-eslint/no-shadow": "error",
371
- "@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "_" }]
370
+ "@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "_" }],
371
+ "@typescript-eslint/no-unused-expressions": [
372
+ "error",
373
+ {
374
+ allowShortCircuit: true,
375
+ allowTaggedTemplates: true,
376
+ allowTernary: true
377
+ }
378
+ ]
372
379
  };
373
380
  var typescriptConfigs = default4.config({
374
381
  extends: [...default4.configs.recommended],
@@ -410,6 +417,7 @@ var importConfigs = [
410
417
  name: "component-hook/allow-default-export",
411
418
  files: [
412
419
  "**/*.d.ts",
420
+ "**/*.md/**",
413
421
  `**/*config*.?([cm])[jt]s?(x)`,
414
422
  `**/{views,pages,routes,middleware,plugins,api}/**/*.?([cm])[jt]s?(x)`,
415
423
  `**/{index,vite,esbuild,rollup,rolldown,webpack,rspack}.ts`
@@ -736,11 +744,11 @@ var configs2 = {
736
744
  "testing-library/marko": testingLibraryMarkoConfig
737
745
  };
738
746
  var eslint_plugin_default = { configs: configs2 };
739
- var recommendedBasic = [...markdownConfigs, sonarjsConfig, securityConfig];
740
- var reactRecommended = [...pluginBasic, ...reactConfig, ...recommendedBasic];
741
- var vueRecommended = [...pluginBasic, ...vueConfigs, ...recommendedBasic];
747
+ var basicPreset = [...markdownConfigs, sonarjsConfig, securityConfig];
748
+ var reactPreset = [...pluginBasic, ...reactConfig, ...basicPreset];
749
+ var vuePreset = [...pluginBasic, ...vueConfigs, ...basicPreset];
742
750
  var vueSkyline = [
743
- ...vueRecommended,
751
+ ...vuePreset,
744
752
  {
745
753
  files: ["**/*.vue"],
746
754
  rules: {
@@ -758,7 +766,7 @@ var vueSkyline = [
758
766
  ];
759
767
  export {
760
768
  eslint_plugin_default as default,
761
- reactRecommended,
762
- vueRecommended,
769
+ reactPreset,
770
+ vuePreset,
763
771
  vueSkyline
764
772
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@component-hook/eslint-plugin",
3
- "version": "0.1.2-alpha.4",
3
+ "version": "0.1.2",
4
4
  "description": "ESLint config for component hook",
5
5
  "license": "MIT",
6
6
  "type": "module",