neatlint 1.1.12 → 1.1.14

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
@@ -49,10 +49,11 @@ Strict ESLint presets for modern TypeScript projects.
49
49
 
50
50
  - Enforces type safety
51
51
  - Encourages modern syntax
52
+ - Encourages the use of arrow functions
52
53
  - Prohibits potentially unsafe patterns
54
+ - Bans `var` and warns about proper use of `const` and `let`
53
55
  - Disallows interfaces, using only types
54
56
  - Requires explicit readonly and accessibility modifiers in classes
55
- - Bans `var` and warns about proper use of `const` and `let`
56
57
  - ...and much more!
57
58
 
58
59
  ## Installation
@@ -140,10 +141,10 @@ Suggested uses are as follows. We recommend using [Prettier](https://npmjs.com/p
140
141
  > "strict": true,
141
142
  > "esModuleInterop": true,
142
143
  >
143
- > "target": "ES2020",
144
- > "module": "esnext",
144
+ > "target": "ESNext",
145
+ > "module": "ESNext",
145
146
  > "moduleResolution": "bundler",
146
- > "lib": ["dom", "ES2020"],
147
+ > "lib": ["DOM", "ESNext"],
147
148
  >
148
149
  > "typeRoots": ["./types", "./node_modules/@types"]
149
150
  > }
package/dist/main.js CHANGED
@@ -40,6 +40,59 @@ var import_lodash = __toESM(require("lodash"));
40
40
  // src/defaults/NeatlintOptions.default.ts
41
41
  var import_typescript_eslint = __toESM(require("typescript-eslint"));
42
42
  var import_js = __toESM(require("@eslint/js"));
43
+ var javascript_rules = {
44
+ configs: {
45
+ ...import_js.default.configs.recommended.rules,
46
+ ...Object.assign(
47
+ {},
48
+ ...import_typescript_eslint.default.configs.strictTypeChecked.map(
49
+ (item) => Object.fromEntries(
50
+ Object.entries(item.rules ?? {}).filter(([key]) => !key.startsWith("@typescript-eslint")).map(([key]) => [key, "error"])
51
+ )
52
+ )
53
+ ),
54
+ ...Object.assign(
55
+ {},
56
+ ...import_typescript_eslint.default.configs.stylisticTypeChecked.map(
57
+ (item) => Object.fromEntries(
58
+ Object.entries(item.rules ?? {}).filter(([key]) => !key.startsWith("@typescript-eslint")).map(([key]) => [key, "error"])
59
+ )
60
+ )
61
+ ),
62
+ ...import_typescript_eslint.default.configs.eslintRecommended.rules
63
+ },
64
+ custom: {
65
+ "func-style": ["error", "expression", { allowArrowFunctions: true }],
66
+ "no-duplicate-imports": "error",
67
+ "no-eval": "error",
68
+ "no-new-func": "error",
69
+ "no-new-wrappers": "error",
70
+ "no-object-constructor": "error",
71
+ "no-restricted-syntax": ["error", "CallExpression[callee.name='String']", "CallExpression[callee.name='Boolean']", "CallExpression[callee.name='parseFloat']", "CallExpression[callee.property.name='forEach']", "DebuggerStatement", "EmptyStatement", "ForInStatement", "LabeledStatement", "SequenceExpression", "SwitchStatement", "WithStatement"],
72
+ "no-useless-call": "error",
73
+ "no-useless-computed-key": "error",
74
+ "no-useless-concat": "error",
75
+ "no-useless-rename": "error",
76
+ "no-useless-return": "error",
77
+ "object-shorthand": "error",
78
+ "prefer-arrow-callback": "error",
79
+ "prefer-template": "error",
80
+ eqeqeq: "error"
81
+ }
82
+ };
83
+ var typescript_rules = {
84
+ configs: {
85
+ ...Object.assign({}, ...import_typescript_eslint.default.configs.strictTypeChecked.map((item) => item.rules ?? {})),
86
+ ...Object.assign({}, ...import_typescript_eslint.default.configs.stylisticTypeChecked.map((item) => item.rules ?? {}))
87
+ },
88
+ custom: {
89
+ "@typescript-eslint/consistent-type-definitions": ["error", "type"],
90
+ "@typescript-eslint/consistent-type-exports": "error",
91
+ "@typescript-eslint/consistent-type-imports": "error",
92
+ "@typescript-eslint/explicit-member-accessibility": "error",
93
+ "@typescript-eslint/prefer-readonly": "error"
94
+ }
95
+ };
43
96
  var NeatlintOptionsDefault = {
44
97
  disabled: false,
45
98
  ignores: ["./dist/**"],
@@ -48,41 +101,8 @@ var NeatlintOptionsDefault = {
48
101
  languageOptions: {},
49
102
  plugins: {},
50
103
  rules: {
51
- ...import_js.default.configs.recommended.rules,
52
- ...Object.assign(
53
- {},
54
- ...import_typescript_eslint.default.configs.strictTypeChecked.map(
55
- (item) => Object.fromEntries(
56
- Object.entries(item.rules ?? {}).filter(([key]) => !key.startsWith("@typescript-eslint")).map(([key]) => [key, "error"])
57
- )
58
- )
59
- ),
60
- ...Object.assign(
61
- {},
62
- ...import_typescript_eslint.default.configs.stylisticTypeChecked.map(
63
- (item) => Object.fromEntries(
64
- Object.entries(item.rules ?? {}).filter(([key]) => !key.startsWith("@typescript-eslint")).map(([key]) => [key, "error"])
65
- )
66
- )
67
- ),
68
- ...import_typescript_eslint.default.configs.eslintRecommended.rules,
69
- "no-undef": "off",
70
- "func-style": ["error", "expression", { allowArrowFunctions: true }],
71
- "no-duplicate-imports": "error",
72
- "no-eval": "error",
73
- "no-new-func": "error",
74
- "no-new-wrappers": "error",
75
- "no-object-constructor": "error",
76
- "no-restricted-syntax": ["error", "CallExpression[callee.name='String']", "CallExpression[callee.name='Boolean']", "CallExpression[callee.name='parseFloat']", "CallExpression[callee.property.name='forEach']", "DebuggerStatement", "EmptyStatement", "ForInStatement", "LabeledStatement", "SequenceExpression", "SwitchStatement", "WithStatement"],
77
- "no-useless-call": "error",
78
- "no-useless-computed-key": "error",
79
- "no-useless-concat": "error",
80
- "no-useless-rename": "error",
81
- "no-useless-return": "error",
82
- "object-shorthand": "error",
83
- "prefer-arrow-callback": "error",
84
- "prefer-template": "error",
85
- eqeqeq: "error"
104
+ ...javascript_rules.configs,
105
+ ...javascript_rules.custom
86
106
  }
87
107
  },
88
108
  typescript: {
@@ -98,14 +118,8 @@ var NeatlintOptionsDefault = {
98
118
  "@typescript-eslint": import_typescript_eslint.default.plugin
99
119
  },
100
120
  rules: {
101
- ...Object.assign({}, ...import_typescript_eslint.default.configs.strictTypeChecked.map((item) => item.rules ?? {})),
102
- ...Object.assign({}, ...import_typescript_eslint.default.configs.stylisticTypeChecked.map((item) => item.rules ?? {})),
103
- "@typescript-eslint/consistent-type-definitions": ["error", "type"],
104
- // stylisticTypeChecked but different
105
- "@typescript-eslint/consistent-type-exports": "error",
106
- "@typescript-eslint/consistent-type-imports": "error",
107
- "@typescript-eslint/explicit-member-accessibility": "error",
108
- "@typescript-eslint/prefer-readonly": "error"
121
+ ...typescript_rules.configs,
122
+ ...typescript_rules.custom
109
123
  }
110
124
  }
111
125
  };
package/dist/main.mjs CHANGED
@@ -4,6 +4,59 @@ import _ from "lodash";
4
4
  // src/defaults/NeatlintOptions.default.ts
5
5
  import TSESLint from "typescript-eslint";
6
6
  import ESLintJS from "@eslint/js";
7
+ var javascript_rules = {
8
+ configs: {
9
+ ...ESLintJS.configs.recommended.rules,
10
+ ...Object.assign(
11
+ {},
12
+ ...TSESLint.configs.strictTypeChecked.map(
13
+ (item) => Object.fromEntries(
14
+ Object.entries(item.rules ?? {}).filter(([key]) => !key.startsWith("@typescript-eslint")).map(([key]) => [key, "error"])
15
+ )
16
+ )
17
+ ),
18
+ ...Object.assign(
19
+ {},
20
+ ...TSESLint.configs.stylisticTypeChecked.map(
21
+ (item) => Object.fromEntries(
22
+ Object.entries(item.rules ?? {}).filter(([key]) => !key.startsWith("@typescript-eslint")).map(([key]) => [key, "error"])
23
+ )
24
+ )
25
+ ),
26
+ ...TSESLint.configs.eslintRecommended.rules
27
+ },
28
+ custom: {
29
+ "func-style": ["error", "expression", { allowArrowFunctions: true }],
30
+ "no-duplicate-imports": "error",
31
+ "no-eval": "error",
32
+ "no-new-func": "error",
33
+ "no-new-wrappers": "error",
34
+ "no-object-constructor": "error",
35
+ "no-restricted-syntax": ["error", "CallExpression[callee.name='String']", "CallExpression[callee.name='Boolean']", "CallExpression[callee.name='parseFloat']", "CallExpression[callee.property.name='forEach']", "DebuggerStatement", "EmptyStatement", "ForInStatement", "LabeledStatement", "SequenceExpression", "SwitchStatement", "WithStatement"],
36
+ "no-useless-call": "error",
37
+ "no-useless-computed-key": "error",
38
+ "no-useless-concat": "error",
39
+ "no-useless-rename": "error",
40
+ "no-useless-return": "error",
41
+ "object-shorthand": "error",
42
+ "prefer-arrow-callback": "error",
43
+ "prefer-template": "error",
44
+ eqeqeq: "error"
45
+ }
46
+ };
47
+ var typescript_rules = {
48
+ configs: {
49
+ ...Object.assign({}, ...TSESLint.configs.strictTypeChecked.map((item) => item.rules ?? {})),
50
+ ...Object.assign({}, ...TSESLint.configs.stylisticTypeChecked.map((item) => item.rules ?? {}))
51
+ },
52
+ custom: {
53
+ "@typescript-eslint/consistent-type-definitions": ["error", "type"],
54
+ "@typescript-eslint/consistent-type-exports": "error",
55
+ "@typescript-eslint/consistent-type-imports": "error",
56
+ "@typescript-eslint/explicit-member-accessibility": "error",
57
+ "@typescript-eslint/prefer-readonly": "error"
58
+ }
59
+ };
7
60
  var NeatlintOptionsDefault = {
8
61
  disabled: false,
9
62
  ignores: ["./dist/**"],
@@ -12,41 +65,8 @@ var NeatlintOptionsDefault = {
12
65
  languageOptions: {},
13
66
  plugins: {},
14
67
  rules: {
15
- ...ESLintJS.configs.recommended.rules,
16
- ...Object.assign(
17
- {},
18
- ...TSESLint.configs.strictTypeChecked.map(
19
- (item) => Object.fromEntries(
20
- Object.entries(item.rules ?? {}).filter(([key]) => !key.startsWith("@typescript-eslint")).map(([key]) => [key, "error"])
21
- )
22
- )
23
- ),
24
- ...Object.assign(
25
- {},
26
- ...TSESLint.configs.stylisticTypeChecked.map(
27
- (item) => Object.fromEntries(
28
- Object.entries(item.rules ?? {}).filter(([key]) => !key.startsWith("@typescript-eslint")).map(([key]) => [key, "error"])
29
- )
30
- )
31
- ),
32
- ...TSESLint.configs.eslintRecommended.rules,
33
- "no-undef": "off",
34
- "func-style": ["error", "expression", { allowArrowFunctions: true }],
35
- "no-duplicate-imports": "error",
36
- "no-eval": "error",
37
- "no-new-func": "error",
38
- "no-new-wrappers": "error",
39
- "no-object-constructor": "error",
40
- "no-restricted-syntax": ["error", "CallExpression[callee.name='String']", "CallExpression[callee.name='Boolean']", "CallExpression[callee.name='parseFloat']", "CallExpression[callee.property.name='forEach']", "DebuggerStatement", "EmptyStatement", "ForInStatement", "LabeledStatement", "SequenceExpression", "SwitchStatement", "WithStatement"],
41
- "no-useless-call": "error",
42
- "no-useless-computed-key": "error",
43
- "no-useless-concat": "error",
44
- "no-useless-rename": "error",
45
- "no-useless-return": "error",
46
- "object-shorthand": "error",
47
- "prefer-arrow-callback": "error",
48
- "prefer-template": "error",
49
- eqeqeq: "error"
68
+ ...javascript_rules.configs,
69
+ ...javascript_rules.custom
50
70
  }
51
71
  },
52
72
  typescript: {
@@ -62,14 +82,8 @@ var NeatlintOptionsDefault = {
62
82
  "@typescript-eslint": TSESLint.plugin
63
83
  },
64
84
  rules: {
65
- ...Object.assign({}, ...TSESLint.configs.strictTypeChecked.map((item) => item.rules ?? {})),
66
- ...Object.assign({}, ...TSESLint.configs.stylisticTypeChecked.map((item) => item.rules ?? {})),
67
- "@typescript-eslint/consistent-type-definitions": ["error", "type"],
68
- // stylisticTypeChecked but different
69
- "@typescript-eslint/consistent-type-exports": "error",
70
- "@typescript-eslint/consistent-type-imports": "error",
71
- "@typescript-eslint/explicit-member-accessibility": "error",
72
- "@typescript-eslint/prefer-readonly": "error"
85
+ ...typescript_rules.configs,
86
+ ...typescript_rules.custom
73
87
  }
74
88
  }
75
89
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neatlint",
3
- "version": "1.1.12",
3
+ "version": "1.1.14",
4
4
  "description": "Strict ESLint presets for modern TypeScript projects.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/keift/neatlint",