@lzear/eslint-config 2.0.0

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.
@@ -0,0 +1,4 @@
1
+ import { FlatESLintConfig } from 'eslint-define-config';
2
+
3
+ declare const config: FlatESLintConfig[];
4
+ export default config;
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";const c=require("eslint-plugin-prefer-arrow"),u=require("eslint-plugin-node-import"),r=require("eslint-plugin-import"),o=require("eslint-plugin-prettier"),n=require("eslint-plugin-promise"),s=require("eslint-plugin-unicorn"),i=require("eslint-plugin-sonarjs"),t=require("eslint-plugin-n"),e=require("globals"),l=require("@eslint/js");const d=[{ignores:["**/node_modules/**","**/dist/**",".git/**"]},l.configs.recommended,{languageOptions:{ecmaVersion:2023,sourceType:"module",globals:{...e.browser,...e.es2021,...e.node}},plugins:{"prefer-arrow":c,"node-import":u,import:r,promise:n,sonarjs:i,unicorn:s,n:t},rules:{...r.configs.recommended.rules,...t.configs.recommended.rules,"node-import/prefer-node-protocol":2,"prefer-arrow/prefer-arrow-functions":[2,{disallowPrototype:!0,singleReturnOnly:!1,classPropertiesAllowed:!1}],...n.configs.recommended.rules,...i.configs.recommended.rules,...s.configs.recommended.rules}},{rules:{"n/no-missing-import":0,"prefer-const":2,"unicorn/no-abusive-eslint-disable":0,"unicorn/no-null":0,"unicorn/prevent-abbreviations":[0,{checkProperties:!0}]}},{plugins:{prettier:o},rules:o.configs.recommended.rules}],m=d;module.exports=m;
package/dist/index.mjs ADDED
@@ -0,0 +1,70 @@
1
+ import t from "eslint-plugin-prefer-arrow";
2
+ import l from "eslint-plugin-node-import";
3
+ import o from "eslint-plugin-import";
4
+ import e from "eslint-plugin-prettier";
5
+ import n from "eslint-plugin-promise";
6
+ import s from "eslint-plugin-unicorn";
7
+ import i from "eslint-plugin-sonarjs";
8
+ import m from "eslint-plugin-n";
9
+ import r from "globals";
10
+ import p from "@eslint/js";
11
+ const c = [
12
+ {
13
+ ignores: ["**/node_modules/**", "**/dist/**", ".git/**"]
14
+ },
15
+ p.configs.recommended,
16
+ {
17
+ languageOptions: {
18
+ ecmaVersion: 2023,
19
+ sourceType: "module",
20
+ globals: {
21
+ ...r.browser,
22
+ ...r.es2021,
23
+ ...r.node
24
+ }
25
+ },
26
+ plugins: {
27
+ "prefer-arrow": t,
28
+ "node-import": l,
29
+ import: o,
30
+ promise: n,
31
+ sonarjs: i,
32
+ unicorn: s,
33
+ n: m
34
+ },
35
+ rules: {
36
+ ...o.configs.recommended.rules,
37
+ ...m.configs.recommended.rules,
38
+ "node-import/prefer-node-protocol": 2,
39
+ "prefer-arrow/prefer-arrow-functions": [
40
+ 2,
41
+ {
42
+ disallowPrototype: !0,
43
+ singleReturnOnly: !1,
44
+ classPropertiesAllowed: !1
45
+ }
46
+ ],
47
+ ...n.configs.recommended.rules,
48
+ ...i.configs.recommended.rules,
49
+ ...s.configs.recommended.rules
50
+ }
51
+ },
52
+ {
53
+ rules: {
54
+ "n/no-missing-import": 0,
55
+ // false positives
56
+ "prefer-const": 2,
57
+ "unicorn/no-abusive-eslint-disable": 0,
58
+ "unicorn/no-null": 0,
59
+ "unicorn/prevent-abbreviations": [0, { checkProperties: !0 }]
60
+ }
61
+ },
62
+ {
63
+ plugins: { prettier: e },
64
+ // @ts-expect-error - no types
65
+ rules: e.configs.recommended.rules
66
+ }
67
+ ], j = c;
68
+ export {
69
+ j as default
70
+ };
package/package.json ADDED
@@ -0,0 +1,66 @@
1
+ {
2
+ "name": "@lzear/eslint-config",
3
+ "description": "ESLint shareable config",
4
+ "version": "2.0.0",
5
+ "repository": "lzear/eslint-config",
6
+ "author": "lzear",
7
+ "license": "MIT",
8
+ "keywords": [
9
+ "eslint",
10
+ "eslint-config",
11
+ "config",
12
+ "code-styles",
13
+ "linter",
14
+ "javascript"
15
+ ],
16
+ "scripts": {
17
+ "build": "vite build"
18
+ },
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "files": [
23
+ "./dist"
24
+ ],
25
+ "exports": {
26
+ ".": {
27
+ "require": "./dist/index.js",
28
+ "import": "./dist/index.mjs",
29
+ "types": "./dist/index.d.ts"
30
+ },
31
+ "./package.json": "./package.json"
32
+ },
33
+ "peerDependencies": {
34
+ "eslint": "^8.50.0",
35
+ "eslint-plugin-import": "^2.28.1",
36
+ "eslint-plugin-n": "^16.1.0",
37
+ "eslint-plugin-node-import": "^1.0.4",
38
+ "eslint-plugin-prefer-arrow": "^1.2.3",
39
+ "eslint-plugin-prettier": "^5.0.1",
40
+ "eslint-plugin-promise": "^6.1.1",
41
+ "eslint-plugin-sonarjs": "^0.21.0",
42
+ "eslint-plugin-unicorn": "^48.0.1"
43
+ },
44
+ "dependencies": {
45
+ "globals": "^13.22.0"
46
+ },
47
+ "devDependencies": {
48
+ "@eslint/js": "^8.51.0",
49
+ "@types/eslint__js": "^8.42.1",
50
+ "eslint": "^8.50.0",
51
+ "eslint-define-config": "^1.23.0",
52
+ "eslint-plugin-import": "^2.28.1",
53
+ "eslint-plugin-n": "^16.1.0",
54
+ "eslint-plugin-node-import": "^1.0.4",
55
+ "eslint-plugin-prefer-arrow": "^1.2.3",
56
+ "eslint-plugin-prettier": "^5.0.1",
57
+ "eslint-plugin-promise": "^6.1.1",
58
+ "eslint-plugin-sonarjs": "^0.21.0",
59
+ "eslint-plugin-unicorn": "^48.0.1",
60
+ "vite": "^4.4.10",
61
+ "vite-plugin-dts": "^3.6.0"
62
+ },
63
+ "volta": {
64
+ "extends": "../package.json"
65
+ }
66
+ }
package/readme.md ADDED
@@ -0,0 +1,36 @@
1
+ # @lzear/eslint-config
2
+
3
+ <img src="https://github-production-user-asset-6210df.s3.amazonaws.com/5698350/241426629-f7e3a5bf-50fe-49c1-ad76-98bd3914cd3e.svg" alt="ESLint" align="right" width="150" height="150" />
4
+
5
+ ![Version](https://img.shields.io/npm/v/@lzear/eslint-config.svg?color=brightgreen)
6
+
7
+ Shareable ESLint config for JavaScript projects.
8
+
9
+ See [docs](https://github.com/lzear/eslint-config/blob/main/base/docs.md) for a
10
+ list of all rules.
11
+
12
+ ## Installation
13
+
14
+ 1. Install package:
15
+
16
+ ```sh
17
+ yarn add --save-dev eslint @lzear/eslint-config eslint-plugin-import eslint-plugin-n eslint-plugin-node-import eslint-plugin-prefer-arrow eslint-plugin-promise eslint-plugin-sonarjs eslint-plugin-unicorn
18
+ ```
19
+
20
+ 2. Create ESLint configuration file `eslint.config.js`:
21
+
22
+ ```js
23
+ import eslintConfig from '@lzear/eslint-config'
24
+
25
+ export default eslintConfig
26
+ ```
27
+
28
+ 3. Add script for package.json:
29
+
30
+ ```js
31
+ {
32
+ "scripts": {
33
+ "lint": "eslint .",
34
+ }
35
+ }
36
+ ```