@neolution-ch/eslint-config-neolution 1.2.0 → 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.
Files changed (80) hide show
  1. package/README.md +20 -28
  2. package/dist/configs/cypress.d.ts +3 -0
  3. package/dist/configs/cypress.d.ts.map +1 -0
  4. package/dist/configs/cypress.js +16 -0
  5. package/dist/configs/cypress.js.map +1 -0
  6. package/dist/configs/get-config.d.ts +4 -0
  7. package/dist/configs/get-config.d.ts.map +1 -0
  8. package/dist/configs/get-config.js +76 -0
  9. package/dist/configs/get-config.js.map +1 -0
  10. package/dist/configs/javascript.d.ts +3 -0
  11. package/dist/configs/javascript.d.ts.map +1 -0
  12. package/dist/configs/javascript.js +15 -0
  13. package/dist/configs/javascript.js.map +1 -0
  14. package/dist/configs/nextjs.d.ts +3 -0
  15. package/dist/configs/nextjs.d.ts.map +1 -0
  16. package/dist/configs/nextjs.js +16 -0
  17. package/dist/configs/nextjs.js.map +1 -0
  18. package/dist/configs/providers/default.d.ts +105 -0
  19. package/dist/configs/providers/default.d.ts.map +1 -0
  20. package/dist/configs/providers/default.js +35 -0
  21. package/dist/configs/providers/default.js.map +1 -0
  22. package/dist/configs/providers/eslint.d.ts +3 -0
  23. package/dist/configs/providers/eslint.d.ts.map +1 -0
  24. package/dist/configs/providers/eslint.js +18 -0
  25. package/dist/configs/providers/eslint.js.map +1 -0
  26. package/dist/configs/providers/importPlugin.d.ts +3 -0
  27. package/dist/configs/providers/importPlugin.d.ts.map +1 -0
  28. package/dist/configs/providers/importPlugin.js +4 -0
  29. package/dist/configs/providers/importPlugin.js.map +1 -0
  30. package/dist/configs/providers/jsdoc.d.ts +4 -0
  31. package/dist/configs/providers/jsdoc.d.ts.map +1 -0
  32. package/dist/configs/providers/jsdoc.js +13 -0
  33. package/dist/configs/providers/jsdoc.js.map +1 -0
  34. package/dist/configs/providers/next.d.ts +3 -0
  35. package/dist/configs/providers/next.d.ts.map +1 -0
  36. package/dist/configs/providers/next.js +6 -0
  37. package/dist/configs/providers/next.js.map +1 -0
  38. package/dist/configs/providers/react.d.ts +5 -0
  39. package/dist/configs/providers/react.d.ts.map +1 -0
  40. package/dist/configs/providers/react.js +23 -0
  41. package/dist/configs/providers/react.js.map +1 -0
  42. package/dist/configs/providers/reactHooks.d.ts +3 -0
  43. package/dist/configs/providers/reactHooks.d.ts.map +1 -0
  44. package/dist/configs/providers/reactHooks.js +10 -0
  45. package/dist/configs/providers/reactHooks.js.map +1 -0
  46. package/dist/configs/providers/typescript.d.ts +3 -0
  47. package/dist/configs/providers/typescript.d.ts.map +1 -0
  48. package/dist/configs/providers/typescript.js +37 -0
  49. package/dist/configs/providers/typescript.js.map +1 -0
  50. package/dist/configs/providers/unicorn.d.ts +3 -0
  51. package/dist/configs/providers/unicorn.d.ts.map +1 -0
  52. package/dist/configs/providers/unicorn.js +32 -0
  53. package/dist/configs/providers/unicorn.js.map +1 -0
  54. package/dist/configs/react-library.d.ts +3 -0
  55. package/dist/configs/react-library.d.ts.map +1 -0
  56. package/dist/configs/react-library.js +15 -0
  57. package/dist/configs/react-library.js.map +1 -0
  58. package/dist/configs/typescript.d.ts +3 -0
  59. package/dist/configs/typescript.d.ts.map +1 -0
  60. package/dist/configs/typescript.js +12 -0
  61. package/dist/configs/typescript.js.map +1 -0
  62. package/dist/index.d.ts +21 -0
  63. package/dist/index.d.ts.map +1 -0
  64. package/dist/index.js +27 -0
  65. package/dist/index.js.map +1 -0
  66. package/package.json +46 -20
  67. package/.editorconfig +0 -58
  68. package/.eslintrc.js +0 -17
  69. package/.github/workflows/ci.yml +0 -46
  70. package/.github/workflows/create-release.yml +0 -51
  71. package/.github/workflows/prepare-release.yml +0 -66
  72. package/CHANGELOG.md +0 -44
  73. package/index.js +0 -11
  74. package/rules/eslint.js +0 -75
  75. package/rules/import.js +0 -36
  76. package/rules/jsdoc.js +0 -25
  77. package/rules/next.js +0 -17
  78. package/rules/react-hooks.js +0 -10
  79. package/rules/react.js +0 -32
  80. package/rules/typescript.js +0 -210
package/rules/jsdoc.js DELETED
@@ -1,25 +0,0 @@
1
- module.exports = {
2
- extends: [
3
- "plugin:jsdoc/recommended"
4
- ],
5
-
6
- plugins: [
7
- "jsdoc"
8
- ],
9
-
10
- // View link below for jsdoc rules documentation
11
- // https://github.com/gajus/eslint-plugin-jsdoc#user-content-eslint-plugin-jsdoc-rules
12
- rules: {
13
- // Do not enforce the empty line after the description block
14
- // https://github.com/gajus/eslint-plugin-jsdoc#newline-after-description
15
- "jsdoc/newline-after-description": "off",
16
-
17
- // Do not require that each @param tag has a type value
18
- // https://github.com/gajus/eslint-plugin-jsdoc#require-param-type
19
- "jsdoc/require-param-type": "off",
20
-
21
- // Do not require that @returns tag has a type value
22
- // https://github.com/gajus/eslint-plugin-jsdoc#require-returns-type
23
- "jsdoc/require-returns-type": "off"
24
- }
25
- };
package/rules/next.js DELETED
@@ -1,17 +0,0 @@
1
- module.exports = {
2
- extends: [
3
- "plugin:@next/next/recommended"
4
- ],
5
-
6
- plugins: [
7
- "@next/next",
8
- ],
9
-
10
- // View link below for next.js rules documentation
11
- // https://nextjs.org/docs/basic-features/eslint#eslint-plugin
12
- rules: {
13
- // Disable because of this bug: https://github.com/vercel/next.js/issues/24421
14
- // https://nextjs.org/docs/messages/no-img-element
15
- "@next/next/no-img-element": "off",
16
- },
17
- };
@@ -1,10 +0,0 @@
1
- module.exports = {
2
- extends: [
3
- "eslint-config-airbnb/hooks",
4
- ].map(require.resolve),
5
-
6
- // View link below for react-hooks rules documentation
7
- // https://reactjs.org/docs/hooks-rules.html
8
- rules: {
9
- },
10
- };
package/rules/react.js DELETED
@@ -1,32 +0,0 @@
1
- module.exports = {
2
- // View link below for react rules documentation
3
- // https://github.com/jsx-eslint/eslint-plugin-react#list-of-supported-rules
4
- rules: {
5
- // The airbnb config forces the destructuring, but it's not always desirable
6
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/destructuring-assignment.md
7
- "react/destructuring-assignment": "off",
8
-
9
- // The airbnb config forces function-expressions, but we prefer arrow-functions
10
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/function-component-definition.md
11
- "react/function-component-definition": ["error", {
12
- namedComponents: "arrow-function",
13
- unnamedComponents: "arrow-function",
14
- }],
15
-
16
- // The airbnb config forces only .jsx, but we support also .tsx
17
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md
18
- "react/jsx-filename-extension": ["error", { extensions: [".jsx", ".tsx"] }],
19
-
20
- // The airbnb config forces one expression per line, but it's not always desirable
21
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-one-expression-per-line.md
22
- "react/jsx-one-expression-per-line": "off",
23
-
24
- // The airbnb config didn't allow component creation inside component props, but we want to allow it
25
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unstable-nested-components.md
26
- "react/no-unstable-nested-components": ["error", { allowAsProps: true }],
27
-
28
- // The airbnb config forces a defaultProps definition for every prop, but we don't want it
29
- // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/require-default-props.md
30
- "react/require-default-props": "off",
31
- },
32
- };
@@ -1,210 +0,0 @@
1
- module.exports = {
2
- extends: [
3
- "plugin:@typescript-eslint/all"
4
- ],
5
-
6
- plugins: [
7
- "@typescript-eslint"
8
- ],
9
-
10
- parser: "@typescript-eslint/parser",
11
-
12
- parserOptions: {
13
- project: "tsconfig.json"
14
- },
15
-
16
- // View link below for typescript rules documentation
17
- // https://typescript-eslint.io/rules/
18
- rules: {
19
- // Disallow certain types
20
- // https://typescript-eslint.io/rules/ban-types/
21
- "@typescript-eslint/ban-types": ["error",{
22
- types: {
23
- "React.StatelessComponent": { message: "Deprecated: Do not use.", fixWith: "React.ReactElement" },
24
- StatelessComponent: { message: "Deprecated: Do not use.", fixWith: "ReactElement" },
25
- "React.FC": { message: "Please use ReactElement + PropsWithChildren", fixWith: "ReactElement" },
26
- FC: { message: "Please use ReactElement + PropsWithChildren", fixWith: "ReactElement" },
27
- },
28
- extendDefaults: true,
29
- }],
30
-
31
- // Enforce one true brace style (same as eslint-config-airbnb-base)
32
- // https://typescript-eslint.io/rules/brace-style
33
- "@typescript-eslint/brace-style": ["error", "1tbs", { allowSingleLine: true }],
34
-
35
- // Require trailing commas in multiline object literals (same as eslint-config-airbnb-base)
36
- // https://typescript-eslint.io/rules/comma-dangle
37
- "@typescript-eslint/comma-dangle": ["error", "always-multiline"],
38
-
39
- // Enforce spacing before and after comma (same as eslint-config-airbnb-base)
40
- // https://typescript-eslint.io/rules/comma-spacing
41
- "@typescript-eslint/comma-spacing": ["error", { before: false, after: true }],
42
-
43
- // Encourages use of dot notation whenever possible (same as eslint-config-airbnb-base)
44
- // https://typescript-eslint.io/rules/dot-notation
45
- "@typescript-eslint/dot-notation": ["error", { allowKeywords: true }],
46
-
47
- // This option sets a specific tab width for your code (same as eslint-config-airbnb-base)
48
- // https://typescript-eslint.io/rules/indent
49
- "@typescript-eslint/indent": ["error", 2, {
50
- SwitchCase: 1,
51
- VariableDeclarator: 1,
52
- outerIIFEBody: 1,
53
- // MemberExpression: null,
54
- FunctionDeclaration: {
55
- parameters: 1,
56
- body: 1
57
- },
58
- FunctionExpression: {
59
- parameters: 1,
60
- body: 1
61
- },
62
- CallExpression: {
63
- arguments: 1
64
- },
65
- ArrayExpression: 1,
66
- ObjectExpression: 1,
67
- ImportDeclaration: 1,
68
- flatTernaryExpressions: false,
69
- // list derived from https://github.com/benjamn/ast-types/blob/HEAD/def/jsx.js
70
- ignoredNodes: [
71
- "JSXElement",
72
- "JSXElement > *",
73
- "JSXAttribute",
74
- "JSXIdentifier",
75
- "JSXNamespacedName",
76
- "JSXMemberExpression",
77
- "JSXSpreadAttribute",
78
- "JSXExpressionContainer",
79
- "JSXOpeningElement",
80
- "JSXClosingElement",
81
- "JSXFragment",
82
- "JSXOpeningFragment",
83
- "JSXClosingFragment",
84
- "JSXText",
85
- "JSXEmptyExpression",
86
- "JSXSpreadChild"
87
- ],
88
- ignoreComments: false
89
- }],
90
-
91
- // Enforce or disallow variable initializations at definition (same as eslint-config-airbnb-base)
92
- // https://typescript-eslint.io/rules/init-declarations
93
- "@typescript-eslint/init-declarations": "off",
94
-
95
- // Require a space before & after certain keywords (same as eslint-config-airbnb-base)
96
- // https://typescript-eslint.io/rules/keyword-spacing
97
- "@typescript-eslint/keyword-spacing": ["error", {
98
- before: true,
99
- after: true,
100
- overrides: {
101
- return: { after: true },
102
- throw: { after: true },
103
- case: { after: true }
104
- }
105
- }],
106
-
107
- // Require or disallow an empty line between class members (same as eslint-config-airbnb-base)
108
- // https://typescript-eslint.io/rules/lines-between-class-members
109
- "@typescript-eslint/lines-between-class-members": ["error", "always", { exceptAfterSingleLine: false }],
110
-
111
- // Force camelCase except for some cases
112
- // https://typescript-eslint.io/rules/naming-convention
113
- "@typescript-eslint/naming-convention": ["error", {
114
- selector: "default",
115
- format: ["camelCase"],
116
- leadingUnderscore: "allow",
117
- },
118
- {
119
- selector: ["typeLike", "accessor", "enumMember"],
120
- format: ["PascalCase"],
121
- }],
122
-
123
- // Disallow empty functions
124
- // https://typescript-eslint.io/rules/no-empty-function
125
- "@typescript-eslint/no-empty-function": ["error", {
126
- allow: [],
127
- }],
128
-
129
- // Disallow unnecessary parentheses (same as eslint-config-airbnb-base)
130
- // https://typescript-eslint.io/rules/no-extra-parens
131
- "@typescript-eslint/no-extra-parens": ["off", "all", {
132
- conditionalAssign: true,
133
- nestedBinaryExpressions: false,
134
- returnAssign: false,
135
- ignoreJSX: "all", // delegate to eslint-plugin-react
136
- enforceForArrowConditionals: false,
137
- }],
138
-
139
- // Disallow classes used as namespaces
140
- // https://typescript-eslint.io/rules/no-extraneous-class
141
- "@typescript-eslint/no-extraneous-class": "off",
142
-
143
- // Disallow void type outside of generic or return types
144
- // https://typescript-eslint.io/rules/no-invalid-void-type
145
- "@typescript-eslint/no-invalid-void-type": "off",
146
-
147
- // Disallow magic numbers (same as eslint-config-airbnb-base)
148
- // https://typescript-eslint.io/rules/no-magic-numbers
149
- "@typescript-eslint/no-magic-numbers": ["off", {
150
- ignore: [],
151
- ignoreArrayIndexes: true,
152
- enforceConst: true,
153
- detectObjects: false,
154
- }],
155
-
156
- // Disallow custom TypeScript modules and namespaces
157
- // https://typescript-eslint.io/rules/no-namespace
158
- "@typescript-eslint/no-namespace": ["error", {
159
- allowDeclarations: true,
160
- allowDefinitionFiles: true,
161
- }],
162
-
163
- // Disallow type aliases
164
- // https://typescript-eslint.io/rules/no-type-alias
165
- "@typescript-eslint/no-type-alias": "off",
166
-
167
- // Disallow declaration of variables that are not used in the code (same as eslint-config-airbnb-base)
168
- // https://typescript-eslint.io/rules/no-unused-vars
169
- "@typescript-eslint/no-unused-vars": ["error", { vars: "all", args: "after-used", ignoreRestSiblings: true }],
170
-
171
- // Require padding inside curly braces (same as eslint-config-airbnb-base)
172
- // https://typescript-eslint.io/rules/object-curly-spacing
173
- "@typescript-eslint/object-curly-spacing": ["error", "always"],
174
-
175
- // Require or disallow padding lines between statements (same as eslint-config-airbnb-base)
176
- // https://typescript-eslint.io/rules/padding-line-between-statements
177
- "@typescript-eslint/padding-line-between-statements": "off",
178
-
179
- // Require function parameters to be typed as readonly to prevent accidental mutation of inputs
180
- // https://typescript-eslint.io/rules/prefer-readonly-parameter-types
181
- "@typescript-eslint/prefer-readonly-parameter-types": "off",
182
-
183
- // Enforce the consistent use of double quotes, but allow single quotes so long as the
184
- // string contains a quote that would have to be escaped otherwise
185
- // https://typescript-eslint.io/rules/quotes
186
- "@typescript-eslint/quotes": ["error", "double", { avoidEscape: true }],
187
-
188
- // Require `await` in `async function` (note: this is a horrible rule that should never be used) (same as eslint-config-airbnb-base)
189
- // https://typescript-eslint.io/rules/require-await
190
- "@typescript-eslint/require-await": "off",
191
-
192
- // Enforce template literal expressions to be of string type, but allow numbers and booleans
193
- // https://typescript-eslint.io/rules/restrict-template-expressions
194
- "@typescript-eslint/restrict-template-expressions": ["error", {
195
- allowNumber: true,
196
- allowBoolean: true,
197
- allowAny: false,
198
- allowNullish: false,
199
- allowRegExp: false,
200
- }],
201
-
202
- // Require or disallow space before function opening parenthesis (same as eslint-config-airbnb-base)
203
- // https://typescript-eslint.io/rules/space-before-function-paren
204
- "@typescript-eslint/space-before-function-paren": ["error", {
205
- anonymous: "always",
206
- named: "never",
207
- asyncArrow: "always"
208
- }],
209
- },
210
- };