@zemd/eslint-js 1.0.0 → 1.0.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
@@ -6,13 +6,14 @@ This package includes a set of ESLint configurations for JavaScript projects.
6
6
 
7
7
  **The package includes**:
8
8
 
9
- | Package | Description | Rules |
10
- | ------------------------------------------------- | ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
11
- | `eslint-config-flat-gitignore` | ignores all files from your `.gitignore` file | |
12
- | `@eslint/js` | standard ESLint rules | `recommended` plus hand-picked rules that were not included |
13
- | `eslint-plugin-unicorn` | modern set of rules | I think pretty opinionated, so I carefully hand-picked rules, avoiding style related rules |
14
- | `eslint-plugin-sonarjs` | ESLint plugin maintained by Sonar, designed to help developers write Clean Code | all `recommended` rules minus some disabled for better DX |
15
- | `@eslint-community/eslint-plugin-eslint-comments` | additional ESLint rules for ESLint directive comments (e.g. //eslint-disable-line) | `recommended` rules |
9
+ | Package | Description | Rules | License |
10
+ | ------------------------------------------------- | ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ | ------------- |
11
+ | `eslint-config-flat-gitignore` | ignores all files from your `.gitignore` file | | MIT |
12
+ | `@eslint/js` | standard ESLint rules | `recommended` plus hand-picked rules that were not included | MIT |
13
+ | `eslint-plugin-unicorn` | modern set of rules | I think pretty opinionated, so I carefully hand-picked rules, avoiding style related rules | MIT |
14
+ | `eslint-plugin-sonarjs` | ESLint plugin maintained by Sonar, designed to help developers write Clean Code | all `recommended` rules minus some disabled for better DX | LGPL-3.0-only |
15
+ | `@eslint-community/eslint-plugin-eslint-comments` | additional ESLint rules for ESLint directive comments (e.g. //eslint-disable-line) | `recommended` rules | MIT |
16
+ | `@eslint/json` | plugin that allows you to natively lint JSON and JSONC | `recommended` rules minus the `sort-keys` | Apache-2.0 |
16
17
 
17
18
  ## Installation
18
19
 
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var v=Object.create;var a=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var k=Object.getPrototypeOf,q=Object.prototype.hasOwnProperty;var b=(r,e)=>a(r,"name",{value:e,configurable:!0});var F=(r,e)=>{for(var n in e)a(r,n,{get:e[n],enumerable:!0})},u=(r,e,n,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of N(e))!q.call(r,s)&&s!==n&&a(r,s,{get:()=>e[s],enumerable:!(c=j(e,s))||c.enumerable});return r},i=(r,e,n)=>(u(r,e,"default"),n&&u(n,e,"default")),t=(r,e,n)=>(n=r!=null?v(k(r)):{},u(e||!r||!r.__esModule?a(n,"default",{value:r,enumerable:!0}):n,r)),P=r=>u(a({},"__esModule",{value:!0}),r);var o={};F(o,{default:()=>E,javascript:()=>x});module.exports=P(o);var d=t(require("eslint-plugin-sonarjs"),1);var y=t(require("eslint-plugin-unicorn"),1),z={"unicorn/error-message":"error","unicorn/escape-case":"error","unicorn/expiring-todo-comments":"error","unicorn/explicit-length-check":"error","unicorn/consistent-existence-index-check":"error","unicorn/new-for-builtins":"error","unicorn/no-abusive-eslint-disable":"error","unicorn/no-array-callback-reference":"error","unicorn/no-array-for-each":"error","unicorn/no-array-method-this-argument":"error","unicorn/no-await-expression-member":"error","unicorn/no-empty-file":"error","unicorn/no-instanceof-array":"error","unicorn/no-invalid-remove-event-listener":"error","unicorn/no-new-buffer":"error","unicorn/no-this-assignment":"error","unicorn/no-unnecessary-await":"error","unicorn/no-useless-fallback-in-spread":"error","unicorn/no-useless-length-check":"error","unicorn/no-useless-promise-resolve-reject":"error","unicorn/no-useless-spread":"error","unicorn/no-useless-switch-case":"error","unicorn/no-zero-fractions":"error","unicorn/no-single-promise-in-promise-methods":"error","unicorn/no-await-in-promise-methods":"error","unicorn/no-invalid-fetch-options":"error","unicorn/no-negation-in-equality-check":"error","unicorn/number-literal-case":"error","unicorn/numeric-separators-style":"error","unicorn/prefer-add-event-listener":"error","unicorn/prefer-array-find":"error","unicorn/prefer-array-flat-map":"error","unicorn/prefer-array-flat":"error","unicorn/prefer-at":"error","unicorn/prefer-blob-reading-methods":"error","unicorn/prefer-code-point":"error","unicorn/prefer-date-now":"error","unicorn/prefer-dom-node-append":"error","unicorn/prefer-dom-node-dataset":"error","unicorn/prefer-dom-node-remove":"error","unicorn/prefer-event-target":"error","unicorn/prefer-export-from":"error","unicorn/prefer-keyboard-event-key":"error","unicorn/prefer-logical-operator-over-ternary":"error","unicorn/prefer-modern-dom-apis":"error","unicorn/prefer-modern-math-apis":"error","unicorn/prefer-negative-index":"error","unicorn/prefer-node-protocol":"error","unicorn/prefer-number-properties":"error","unicorn/prefer-optional-catch-binding":"error","unicorn/prefer-prototype-methods":"error","unicorn/prefer-query-selector":"error","unicorn/prefer-reflect-apply":"error","unicorn/prefer-regexp-test":"error","unicorn/prefer-set-size":"error","unicorn/prefer-string-replace-all":"error","unicorn/prefer-string-slice":"error","unicorn/prefer-string-starts-ends-with":"error","unicorn/prefer-string-trim-start-end":"error","unicorn/prefer-type-error":"error","unicorn/prefer-string-raw":"error","unicorn/prefer-structured-clone":"error","unicorn/prefer-math-min-max":"error","unicorn/prefer-global-this":"error","unicorn/relative-url-style":"error","unicorn/require-array-join-separator":"error","unicorn/require-number-to-fixed-digits-argument":"error","unicorn/switch-case-braces":"error","unicorn/text-encoding-identifier-case":"error","unicorn/throw-new-error":"error"},p={plugins:{unicorn:y.default},rules:z};var m=t(require("@eslint/js"),1),O={"no-promise-executor-return":["error"],"no-unreachable-loop":["error"],"no-caller":["error"],"no-extend-native":["error"],"no-extra-bind":["error"],"no-extra-label":["error"],"no-multi-str":["error"],"no-new-wrappers":["error"],"no-object-constructor":["error"],"no-restricted-properties":["error",{object:"global",property:"isFinite",message:"Please use Number.isFinite instead"},{object:"self",property:"isFinite",message:"Please use Number.isFinite instead"},{object:"window",property:"isFinite",message:"Please use Number.isFinite instead"},{object:"global",property:"isNaN",message:"Please use Number.isNaN instead"},{object:"self",property:"isNaN",message:"Please use Number.isNaN instead"},{object:"window",property:"isNaN",message:"Please use Number.isNaN instead"}],"no-octal-escape":["error"],"no-proto":["error"],"no-sequences":["error",{allowInParentheses:!0}],"no-void":["error"],"no-array-constructor":["error"],"no-multi-assign":["error"],"no-plusplus":["error"],"no-useless-call":["error"],"prefer-object-has-own":["error"],"no-lone-blocks":["error"],"no-return-assign":["error","always"],"no-else-return":["error"],"prefer-template":["error"],"no-param-reassign":["error"],"array-callback-return":["error",{allowImplicit:!0,checkForEach:!0}],eqeqeq:["error"],"prefer-arrow-callback":["error"],"arrow-body-style":["error","always"],"no-restricted-syntax":["error",{selector:"TSEnumDeclaration",message:"Avoid enums. Use union types instead."}]},f={plugins:{eslint:m.default},rules:{...m.default.configs.recommended.rules,...O}};var h=require("@zemd/eslint-common"),g=t(require("@eslint-community/eslint-plugin-eslint-comments"),1),w=t(require("eslint-config-flat-gitignore"),1),l=t(require("globals"),1);i(o,require("@zemd/eslint-common"),module.exports);function x({ecmaVersion:r=2022,sourceType:e="module",files:n=[h.GLOB_SRC],...c}={}){return[(0,w.default)({name:"zemd/gitignore/ignores"}),{name:"zemd/javascript/files",languageOptions:{sourceType:"commonjs"},files:["eslint.config.js"]},{name:"zemd/javascript/setup",languageOptions:{ecmaVersion:r,globals:{...l.default.browser,...l.default.es2021,...l.default.node,document:"readonly",navigator:"readonly",window:"readonly",...c.globals},sourceType:e}},{name:"zemd/javascript/rules",files:n,plugins:{...f.plugins,...p.plugins,sonarjs:d.default,"@eslint-community/eslint-comments":g.default},rules:{...f.rules,...p.rules,...d.default.configs.recommended.rules,"sonarjs/no-clear-text-protocols":["off"],"sonarjs/no-useless-intersection":["off"],...g.default.configs.recommended.rules}}]}b(x,"javascript");var E=x;0&&(module.exports={javascript,...require("@zemd/eslint-common")});
1
+ "use strict";var z=Object.create;var u=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,_=Object.prototype.hasOwnProperty;var l=(r,e)=>u(r,"name",{value:e,configurable:!0});var G=(r,e)=>{for(var n in e)u(r,n,{get:e[n],enumerable:!0})},m=(r,e,n,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of q(e))!_.call(r,t)&&t!==n&&u(r,t,{get:()=>e[t],enumerable:!(c=S(e,t))||c.enumerable});return r},s=(r,e,n)=>(m(r,e,"default"),n&&m(n,e,"default")),a=(r,e,n)=>(n=r!=null?z(F(r)):{},m(e||!r||!r.__esModule?u(n,"default",{value:r,enumerable:!0}):n,r)),P=r=>m(u({},"__esModule",{value:!0}),r);var o={};G(o,{default:()=>k,javascript:()=>O,json:()=>y});module.exports=P(o);var j=a(require("eslint-plugin-sonarjs"),1);var w=a(require("eslint-plugin-unicorn"),1),B={"unicorn/error-message":"error","unicorn/escape-case":"error","unicorn/expiring-todo-comments":"error","unicorn/explicit-length-check":"error","unicorn/consistent-existence-index-check":"error","unicorn/new-for-builtins":"error","unicorn/no-abusive-eslint-disable":"error","unicorn/no-array-callback-reference":"error","unicorn/no-array-for-each":"error","unicorn/no-array-method-this-argument":"error","unicorn/no-await-expression-member":"error","unicorn/no-empty-file":"error","unicorn/no-instanceof-array":"error","unicorn/no-invalid-remove-event-listener":"error","unicorn/no-new-buffer":"error","unicorn/no-this-assignment":"error","unicorn/no-unnecessary-await":"error","unicorn/no-useless-fallback-in-spread":"error","unicorn/no-useless-length-check":"error","unicorn/no-useless-promise-resolve-reject":"error","unicorn/no-useless-spread":"error","unicorn/no-useless-switch-case":"error","unicorn/no-zero-fractions":"error","unicorn/no-single-promise-in-promise-methods":"error","unicorn/no-await-in-promise-methods":"error","unicorn/no-invalid-fetch-options":"error","unicorn/no-negation-in-equality-check":"error","unicorn/number-literal-case":"error","unicorn/numeric-separators-style":"error","unicorn/prefer-add-event-listener":"error","unicorn/prefer-array-find":"error","unicorn/prefer-array-flat-map":"error","unicorn/prefer-array-flat":"error","unicorn/prefer-at":"error","unicorn/prefer-blob-reading-methods":"error","unicorn/prefer-code-point":"error","unicorn/prefer-date-now":"error","unicorn/prefer-dom-node-append":"error","unicorn/prefer-dom-node-dataset":"error","unicorn/prefer-dom-node-remove":"error","unicorn/prefer-event-target":"error","unicorn/prefer-export-from":"error","unicorn/prefer-keyboard-event-key":"error","unicorn/prefer-logical-operator-over-ternary":"error","unicorn/prefer-modern-dom-apis":"error","unicorn/prefer-modern-math-apis":"error","unicorn/prefer-negative-index":"error","unicorn/prefer-node-protocol":"error","unicorn/prefer-number-properties":"error","unicorn/prefer-optional-catch-binding":"error","unicorn/prefer-prototype-methods":"error","unicorn/prefer-query-selector":"error","unicorn/prefer-reflect-apply":"error","unicorn/prefer-regexp-test":"error","unicorn/prefer-set-size":"error","unicorn/prefer-string-replace-all":"error","unicorn/prefer-string-slice":"error","unicorn/prefer-string-starts-ends-with":"error","unicorn/prefer-string-trim-start-end":"error","unicorn/prefer-type-error":"error","unicorn/prefer-string-raw":"error","unicorn/prefer-structured-clone":"error","unicorn/prefer-math-min-max":"error","unicorn/prefer-global-this":"error","unicorn/relative-url-style":"error","unicorn/require-array-join-separator":"error","unicorn/require-number-to-fixed-digits-argument":"error","unicorn/switch-case-braces":"error","unicorn/text-encoding-identifier-case":"error","unicorn/throw-new-error":"error"},d={plugins:{unicorn:w.default},rules:B};var g=a(require("@eslint/js"),1),C={"no-promise-executor-return":["error"],"no-unreachable-loop":["error"],"no-caller":["error"],"no-extend-native":["error"],"no-extra-bind":["error"],"no-extra-label":["error"],"no-multi-str":["error"],"no-new-wrappers":["error"],"no-object-constructor":["error"],"no-restricted-properties":["error",{object:"global",property:"isFinite",message:"Please use Number.isFinite instead"},{object:"self",property:"isFinite",message:"Please use Number.isFinite instead"},{object:"window",property:"isFinite",message:"Please use Number.isFinite instead"},{object:"global",property:"isNaN",message:"Please use Number.isNaN instead"},{object:"self",property:"isNaN",message:"Please use Number.isNaN instead"},{object:"window",property:"isNaN",message:"Please use Number.isNaN instead"}],"no-octal-escape":["error"],"no-proto":["error"],"no-sequences":["error",{allowInParentheses:!0}],"no-void":["error"],"no-array-constructor":["error"],"no-multi-assign":["error"],"no-plusplus":["error"],"no-useless-call":["error"],"prefer-object-has-own":["error"],"no-lone-blocks":["error"],"no-return-assign":["error","always"],"no-else-return":["error"],"prefer-template":["error"],"no-param-reassign":["error"],"array-callback-return":["error",{allowImplicit:!0,checkForEach:!0}],eqeqeq:["error"],"prefer-arrow-callback":["error"],"arrow-body-style":["error","always"],"no-restricted-syntax":["error",{selector:"TSEnumDeclaration",message:"Avoid enums. Use union types instead."}]},b={plugins:{eslint:g.default},rules:{...g.default.configs.recommended.rules,...C}};var N=require("@zemd/eslint-common"),h=a(require("@eslint-community/eslint-plugin-eslint-comments"),1),v=a(require("eslint-config-flat-gitignore"),1),f=a(require("globals"),1);var p=a(require("@eslint/json"),1),i=require("@zemd/eslint-common");function y({jsonFiles:r=[i.GLOB_JSON],jsoncFiles:e=[i.GLOB_JSONC,i.GLOB_JSONC_TSCONFIG,i.GLOB_JSONC_VSCODE],json5Files:n=[i.GLOB_JSON5],jsoncLanguageOptions:c={}}={}){return[{name:"zemd/json/setup",plugins:{json:p.default}},{name:"zemd/json/files",files:r,language:"json/json",rules:{...p.default.configs.recommended.rules}},{name:"zemd/jsonc/files",files:e,language:"json/jsonc",languageOptions:c,rules:{...p.default.configs.recommended.rules}},{name:"zemd/json5/files",files:n,language:"json/json5",rules:{...p.default.configs.recommended.rules}}]}l(y,"json");var x=y;s(o,require("@zemd/eslint-common"),module.exports);function O({ecmaVersion:r=2022,sourceType:e="module",files:n=[N.GLOB_SRC],...c}={}){return[(0,v.default)({name:"zemd/gitignore/ignores"}),{name:"zemd/javascript/files",languageOptions:{sourceType:"commonjs"},files:["eslint.config.js"]},{name:"zemd/javascript/setup",languageOptions:{ecmaVersion:r,globals:{...f.default.browser,...f.default.es2021,...f.default.node,document:"readonly",navigator:"readonly",window:"readonly",...c.globals},sourceType:e}},{name:"zemd/javascript/rules",files:n,plugins:{...b.plugins,...d.plugins,sonarjs:j.default,"@eslint-community/eslint-comments":h.default},rules:{...b.rules,...d.rules,...j.default.configs.recommended.rules,"sonarjs/no-clear-text-protocols":["off"],"sonarjs/no-useless-intersection":["off"],...h.default.configs.recommended.rules}}]}l(O,"javascript");function k(...r){return[...O(...r),...x()]}l(k,"default");0&&(module.exports={javascript,json,...require("@zemd/eslint-common")});
package/dist/index.d.cts CHANGED
@@ -1,5 +1,14 @@
1
1
  import { Linter } from 'eslint';
2
2
  export * from '@zemd/eslint-common';
3
+ import { JSONLanguageOptions } from '@eslint/json';
4
+
5
+ type JSONOptions = {
6
+ jsonFiles: string[];
7
+ jsoncFiles: string[];
8
+ jsoncLanguageOptions: JSONLanguageOptions;
9
+ json5Files: string[];
10
+ };
11
+ declare function json({ jsonFiles, jsoncFiles, json5Files, jsoncLanguageOptions, }?: Partial<JSONOptions>): Array<Linter.Config>;
3
12
 
4
13
  /**
5
14
  * The ECMAScript version of the code being linted.
@@ -16,5 +25,6 @@ type JavascriptOptions = {
16
25
  files: string[];
17
26
  };
18
27
  declare function javascript({ ecmaVersion, sourceType, files, ...opts }?: Partial<JavascriptOptions>): Array<Linter.Config>;
28
+ declare function export_default(...params: Parameters<typeof javascript>): Array<Linter.Config>;
19
29
 
20
- export { javascript as default, javascript };
30
+ export { export_default as default, javascript, json };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,14 @@
1
1
  import { Linter } from 'eslint';
2
2
  export * from '@zemd/eslint-common';
3
+ import { JSONLanguageOptions } from '@eslint/json';
4
+
5
+ type JSONOptions = {
6
+ jsonFiles: string[];
7
+ jsoncFiles: string[];
8
+ jsoncLanguageOptions: JSONLanguageOptions;
9
+ json5Files: string[];
10
+ };
11
+ declare function json({ jsonFiles, jsoncFiles, json5Files, jsoncLanguageOptions, }?: Partial<JSONOptions>): Array<Linter.Config>;
3
12
 
4
13
  /**
5
14
  * The ECMAScript version of the code being linted.
@@ -16,5 +25,6 @@ type JavascriptOptions = {
16
25
  files: string[];
17
26
  };
18
27
  declare function javascript({ ecmaVersion, sourceType, files, ...opts }?: Partial<JavascriptOptions>): Array<Linter.Config>;
28
+ declare function export_default(...params: Parameters<typeof javascript>): Array<Linter.Config>;
19
29
 
20
- export { javascript as default, javascript };
30
+ export { export_default as default, javascript, json };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var p=Object.defineProperty;var s=(r,e)=>p(r,"name",{value:e,configurable:!0});import a from"eslint-plugin-sonarjs";import m from"eslint-plugin-unicorn";var f={"unicorn/error-message":"error","unicorn/escape-case":"error","unicorn/expiring-todo-comments":"error","unicorn/explicit-length-check":"error","unicorn/consistent-existence-index-check":"error","unicorn/new-for-builtins":"error","unicorn/no-abusive-eslint-disable":"error","unicorn/no-array-callback-reference":"error","unicorn/no-array-for-each":"error","unicorn/no-array-method-this-argument":"error","unicorn/no-await-expression-member":"error","unicorn/no-empty-file":"error","unicorn/no-instanceof-array":"error","unicorn/no-invalid-remove-event-listener":"error","unicorn/no-new-buffer":"error","unicorn/no-this-assignment":"error","unicorn/no-unnecessary-await":"error","unicorn/no-useless-fallback-in-spread":"error","unicorn/no-useless-length-check":"error","unicorn/no-useless-promise-resolve-reject":"error","unicorn/no-useless-spread":"error","unicorn/no-useless-switch-case":"error","unicorn/no-zero-fractions":"error","unicorn/no-single-promise-in-promise-methods":"error","unicorn/no-await-in-promise-methods":"error","unicorn/no-invalid-fetch-options":"error","unicorn/no-negation-in-equality-check":"error","unicorn/number-literal-case":"error","unicorn/numeric-separators-style":"error","unicorn/prefer-add-event-listener":"error","unicorn/prefer-array-find":"error","unicorn/prefer-array-flat-map":"error","unicorn/prefer-array-flat":"error","unicorn/prefer-at":"error","unicorn/prefer-blob-reading-methods":"error","unicorn/prefer-code-point":"error","unicorn/prefer-date-now":"error","unicorn/prefer-dom-node-append":"error","unicorn/prefer-dom-node-dataset":"error","unicorn/prefer-dom-node-remove":"error","unicorn/prefer-event-target":"error","unicorn/prefer-export-from":"error","unicorn/prefer-keyboard-event-key":"error","unicorn/prefer-logical-operator-over-ternary":"error","unicorn/prefer-modern-dom-apis":"error","unicorn/prefer-modern-math-apis":"error","unicorn/prefer-negative-index":"error","unicorn/prefer-node-protocol":"error","unicorn/prefer-number-properties":"error","unicorn/prefer-optional-catch-binding":"error","unicorn/prefer-prototype-methods":"error","unicorn/prefer-query-selector":"error","unicorn/prefer-reflect-apply":"error","unicorn/prefer-regexp-test":"error","unicorn/prefer-set-size":"error","unicorn/prefer-string-replace-all":"error","unicorn/prefer-string-slice":"error","unicorn/prefer-string-starts-ends-with":"error","unicorn/prefer-string-trim-start-end":"error","unicorn/prefer-type-error":"error","unicorn/prefer-string-raw":"error","unicorn/prefer-structured-clone":"error","unicorn/prefer-math-min-max":"error","unicorn/prefer-global-this":"error","unicorn/relative-url-style":"error","unicorn/require-array-join-separator":"error","unicorn/require-number-to-fixed-digits-argument":"error","unicorn/switch-case-braces":"error","unicorn/text-encoding-identifier-case":"error","unicorn/throw-new-error":"error"},o={plugins:{unicorn:m},rules:f};import t from"@eslint/js";var d={"no-promise-executor-return":["error"],"no-unreachable-loop":["error"],"no-caller":["error"],"no-extend-native":["error"],"no-extra-bind":["error"],"no-extra-label":["error"],"no-multi-str":["error"],"no-new-wrappers":["error"],"no-object-constructor":["error"],"no-restricted-properties":["error",{object:"global",property:"isFinite",message:"Please use Number.isFinite instead"},{object:"self",property:"isFinite",message:"Please use Number.isFinite instead"},{object:"window",property:"isFinite",message:"Please use Number.isFinite instead"},{object:"global",property:"isNaN",message:"Please use Number.isNaN instead"},{object:"self",property:"isNaN",message:"Please use Number.isNaN instead"},{object:"window",property:"isNaN",message:"Please use Number.isNaN instead"}],"no-octal-escape":["error"],"no-proto":["error"],"no-sequences":["error",{allowInParentheses:!0}],"no-void":["error"],"no-array-constructor":["error"],"no-multi-assign":["error"],"no-plusplus":["error"],"no-useless-call":["error"],"prefer-object-has-own":["error"],"no-lone-blocks":["error"],"no-return-assign":["error","always"],"no-else-return":["error"],"prefer-template":["error"],"no-param-reassign":["error"],"array-callback-return":["error",{allowImplicit:!0,checkForEach:!0}],eqeqeq:["error"],"prefer-arrow-callback":["error"],"arrow-body-style":["error","always"],"no-restricted-syntax":["error",{selector:"TSEnumDeclaration",message:"Avoid enums. Use union types instead."}]},n={plugins:{eslint:t},rules:{...t.configs.recommended.rules,...d}};import{GLOB_SRC as g}from"@zemd/eslint-common";import c from"@eslint-community/eslint-plugin-eslint-comments";import b from"eslint-config-flat-gitignore";import i from"globals";export*from"@zemd/eslint-common";function y({ecmaVersion:r=2022,sourceType:e="module",files:u=[g],...l}={}){return[b({name:"zemd/gitignore/ignores"}),{name:"zemd/javascript/files",languageOptions:{sourceType:"commonjs"},files:["eslint.config.js"]},{name:"zemd/javascript/setup",languageOptions:{ecmaVersion:r,globals:{...i.browser,...i.es2021,...i.node,document:"readonly",navigator:"readonly",window:"readonly",...l.globals},sourceType:e}},{name:"zemd/javascript/rules",files:u,plugins:{...n.plugins,...o.plugins,sonarjs:a,"@eslint-community/eslint-comments":c},rules:{...n.rules,...o.rules,...a.configs.recommended.rules,"sonarjs/no-clear-text-protocols":["off"],"sonarjs/no-useless-intersection":["off"],...c.configs.recommended.rules}}]}s(y,"javascript");var I=y;export{I as default,y as javascript};
1
+ var g=Object.defineProperty;var o=(r,e)=>g(r,"name",{value:e,configurable:!0});import m from"eslint-plugin-sonarjs";import b from"eslint-plugin-unicorn";var y={"unicorn/error-message":"error","unicorn/escape-case":"error","unicorn/expiring-todo-comments":"error","unicorn/explicit-length-check":"error","unicorn/consistent-existence-index-check":"error","unicorn/new-for-builtins":"error","unicorn/no-abusive-eslint-disable":"error","unicorn/no-array-callback-reference":"error","unicorn/no-array-for-each":"error","unicorn/no-array-method-this-argument":"error","unicorn/no-await-expression-member":"error","unicorn/no-empty-file":"error","unicorn/no-instanceof-array":"error","unicorn/no-invalid-remove-event-listener":"error","unicorn/no-new-buffer":"error","unicorn/no-this-assignment":"error","unicorn/no-unnecessary-await":"error","unicorn/no-useless-fallback-in-spread":"error","unicorn/no-useless-length-check":"error","unicorn/no-useless-promise-resolve-reject":"error","unicorn/no-useless-spread":"error","unicorn/no-useless-switch-case":"error","unicorn/no-zero-fractions":"error","unicorn/no-single-promise-in-promise-methods":"error","unicorn/no-await-in-promise-methods":"error","unicorn/no-invalid-fetch-options":"error","unicorn/no-negation-in-equality-check":"error","unicorn/number-literal-case":"error","unicorn/numeric-separators-style":"error","unicorn/prefer-add-event-listener":"error","unicorn/prefer-array-find":"error","unicorn/prefer-array-flat-map":"error","unicorn/prefer-array-flat":"error","unicorn/prefer-at":"error","unicorn/prefer-blob-reading-methods":"error","unicorn/prefer-code-point":"error","unicorn/prefer-date-now":"error","unicorn/prefer-dom-node-append":"error","unicorn/prefer-dom-node-dataset":"error","unicorn/prefer-dom-node-remove":"error","unicorn/prefer-event-target":"error","unicorn/prefer-export-from":"error","unicorn/prefer-keyboard-event-key":"error","unicorn/prefer-logical-operator-over-ternary":"error","unicorn/prefer-modern-dom-apis":"error","unicorn/prefer-modern-math-apis":"error","unicorn/prefer-negative-index":"error","unicorn/prefer-node-protocol":"error","unicorn/prefer-number-properties":"error","unicorn/prefer-optional-catch-binding":"error","unicorn/prefer-prototype-methods":"error","unicorn/prefer-query-selector":"error","unicorn/prefer-reflect-apply":"error","unicorn/prefer-regexp-test":"error","unicorn/prefer-set-size":"error","unicorn/prefer-string-replace-all":"error","unicorn/prefer-string-slice":"error","unicorn/prefer-string-starts-ends-with":"error","unicorn/prefer-string-trim-start-end":"error","unicorn/prefer-type-error":"error","unicorn/prefer-string-raw":"error","unicorn/prefer-structured-clone":"error","unicorn/prefer-math-min-max":"error","unicorn/prefer-global-this":"error","unicorn/relative-url-style":"error","unicorn/require-array-join-separator":"error","unicorn/require-number-to-fixed-digits-argument":"error","unicorn/switch-case-braces":"error","unicorn/text-encoding-identifier-case":"error","unicorn/throw-new-error":"error"},t={plugins:{unicorn:b},rules:y};import u from"@eslint/js";var j={"no-promise-executor-return":["error"],"no-unreachable-loop":["error"],"no-caller":["error"],"no-extend-native":["error"],"no-extra-bind":["error"],"no-extra-label":["error"],"no-multi-str":["error"],"no-new-wrappers":["error"],"no-object-constructor":["error"],"no-restricted-properties":["error",{object:"global",property:"isFinite",message:"Please use Number.isFinite instead"},{object:"self",property:"isFinite",message:"Please use Number.isFinite instead"},{object:"window",property:"isFinite",message:"Please use Number.isFinite instead"},{object:"global",property:"isNaN",message:"Please use Number.isNaN instead"},{object:"self",property:"isNaN",message:"Please use Number.isNaN instead"},{object:"window",property:"isNaN",message:"Please use Number.isNaN instead"}],"no-octal-escape":["error"],"no-proto":["error"],"no-sequences":["error",{allowInParentheses:!0}],"no-void":["error"],"no-array-constructor":["error"],"no-multi-assign":["error"],"no-plusplus":["error"],"no-useless-call":["error"],"prefer-object-has-own":["error"],"no-lone-blocks":["error"],"no-return-assign":["error","always"],"no-else-return":["error"],"prefer-template":["error"],"no-param-reassign":["error"],"array-callback-return":["error",{allowImplicit:!0,checkForEach:!0}],eqeqeq:["error"],"prefer-arrow-callback":["error"],"arrow-body-style":["error","always"],"no-restricted-syntax":["error",{selector:"TSEnumDeclaration",message:"Avoid enums. Use union types instead."}]},a={plugins:{eslint:u},rules:{...u.configs.recommended.rules,...j}};import{GLOB_SRC as O}from"@zemd/eslint-common";import f from"@eslint-community/eslint-plugin-eslint-comments";import k from"eslint-config-flat-gitignore";import c from"globals";import n from"@eslint/json";import{GLOB_JSONC_VSCODE as h,GLOB_JSON as w,GLOB_JSON5 as x,GLOB_JSONC as N,GLOB_JSONC_TSCONFIG as v}from"@zemd/eslint-common";function l({jsonFiles:r=[w],jsoncFiles:e=[N,v,h],json5Files:s=[x],jsoncLanguageOptions:i={}}={}){return[{name:"zemd/json/setup",plugins:{json:n}},{name:"zemd/json/files",files:r,language:"json/json",rules:{...n.configs.recommended.rules}},{name:"zemd/jsonc/files",files:e,language:"json/jsonc",languageOptions:i,rules:{...n.configs.recommended.rules}},{name:"zemd/json5/files",files:s,language:"json/json5",rules:{...n.configs.recommended.rules}}]}o(l,"json");var p=l;export*from"@zemd/eslint-common";function z({ecmaVersion:r=2022,sourceType:e="module",files:s=[O],...i}={}){return[k({name:"zemd/gitignore/ignores"}),{name:"zemd/javascript/files",languageOptions:{sourceType:"commonjs"},files:["eslint.config.js"]},{name:"zemd/javascript/setup",languageOptions:{ecmaVersion:r,globals:{...c.browser,...c.es2021,...c.node,document:"readonly",navigator:"readonly",window:"readonly",...i.globals},sourceType:e}},{name:"zemd/javascript/rules",files:s,plugins:{...a.plugins,...t.plugins,sonarjs:m,"@eslint-community/eslint-comments":f},rules:{...a.rules,...t.rules,...m.configs.recommended.rules,"sonarjs/no-clear-text-protocols":["off"],"sonarjs/no-useless-intersection":["off"],...f.configs.recommended.rules}}]}o(z,"javascript");function S(...r){return[...z(...r),...p()]}o(S,"default");export{S as default,z as javascript,l as json};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zemd/eslint-js",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Shared ESLint config for javascript projects",
6
6
  "keywords": [
@@ -43,19 +43,20 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
46
- "@eslint/js": "^9.18.0",
47
- "eslint-config-flat-gitignore": "^1.0.0",
48
- "eslint-plugin-sonarjs": "^3.0.1",
46
+ "@eslint/js": "^9.20.0",
47
+ "@eslint/json": "^0.10.0",
48
+ "eslint-config-flat-gitignore": "^2.0.0",
49
+ "eslint-plugin-sonarjs": "^3.0.2",
49
50
  "eslint-plugin-unicorn": "^56.0.1",
50
- "globals": "^15.14.0",
51
- "@zemd/eslint-common": "1.0.0"
51
+ "globals": "^15.15.0",
52
+ "@zemd/eslint-common": "1.0.1"
52
53
  },
53
54
  "devDependencies": {
54
55
  "@types/eslint": "^9.6.1",
55
56
  "@types/eslint__js": "^8.42.3",
56
57
  "@zemd/tsconfig": "^1.3.0",
57
- "eslint": "^9.18.0",
58
- "tsup": "^8.3.5",
58
+ "eslint": "^9.20.1",
59
+ "tsup": "^8.3.6",
59
60
  "typescript": "^5.7.3"
60
61
  },
61
62
  "scripts": {