@neolution-ch/eslint-config-neolution 1.3.0 → 2.1.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.
- package/README.md +20 -28
- package/dist/configs/cypress.d.ts +4 -0
- package/dist/configs/cypress.d.ts.map +1 -0
- package/dist/configs/cypress.js +16 -0
- package/dist/configs/cypress.js.map +1 -0
- package/dist/configs/get-config.d.ts +10 -0
- package/dist/configs/get-config.d.ts.map +1 -0
- package/dist/configs/get-config.js +88 -0
- package/dist/configs/get-config.js.map +1 -0
- package/dist/configs/javascript.d.ts +4 -0
- package/dist/configs/javascript.d.ts.map +1 -0
- package/dist/configs/javascript.js +15 -0
- package/dist/configs/javascript.js.map +1 -0
- package/dist/configs/nextjs.d.ts +4 -0
- package/dist/configs/nextjs.d.ts.map +1 -0
- package/dist/configs/nextjs.js +16 -0
- package/dist/configs/nextjs.js.map +1 -0
- package/dist/configs/providers/default.d.ts +105 -0
- package/dist/configs/providers/default.d.ts.map +1 -0
- package/dist/configs/providers/default.js +41 -0
- package/dist/configs/providers/default.js.map +1 -0
- package/dist/configs/providers/eslint.d.ts +3 -0
- package/dist/configs/providers/eslint.d.ts.map +1 -0
- package/dist/configs/providers/eslint.js +18 -0
- package/dist/configs/providers/eslint.js.map +1 -0
- package/dist/configs/providers/importPlugin.d.ts +3 -0
- package/dist/configs/providers/importPlugin.d.ts.map +1 -0
- package/dist/configs/providers/importPlugin.js +4 -0
- package/dist/configs/providers/importPlugin.js.map +1 -0
- package/dist/configs/providers/jsdoc.d.ts +5 -0
- package/dist/configs/providers/jsdoc.d.ts.map +1 -0
- package/dist/configs/providers/jsdoc.js +49 -0
- package/dist/configs/providers/jsdoc.js.map +1 -0
- package/dist/configs/providers/next.d.ts +3 -0
- package/dist/configs/providers/next.d.ts.map +1 -0
- package/dist/configs/providers/next.js +6 -0
- package/dist/configs/providers/next.js.map +1 -0
- package/dist/configs/providers/react.d.ts +4 -0
- package/dist/configs/providers/react.d.ts.map +1 -0
- package/dist/configs/providers/react.js +28 -0
- package/dist/configs/providers/react.js.map +1 -0
- package/dist/configs/providers/reactHooks.d.ts +3 -0
- package/dist/configs/providers/reactHooks.d.ts.map +1 -0
- package/dist/configs/providers/reactHooks.js +10 -0
- package/dist/configs/providers/reactHooks.js.map +1 -0
- package/dist/configs/providers/typescript.d.ts +3 -0
- package/dist/configs/providers/typescript.d.ts.map +1 -0
- package/dist/configs/providers/typescript.js +37 -0
- package/dist/configs/providers/typescript.js.map +1 -0
- package/dist/configs/providers/unicorn.d.ts +3 -0
- package/dist/configs/providers/unicorn.d.ts.map +1 -0
- package/dist/configs/providers/unicorn.js +32 -0
- package/dist/configs/providers/unicorn.js.map +1 -0
- package/dist/configs/react-library.d.ts +4 -0
- package/dist/configs/react-library.d.ts.map +1 -0
- package/dist/configs/react-library.js +15 -0
- package/dist/configs/react-library.js.map +1 -0
- package/dist/configs/typescript.d.ts +4 -0
- package/dist/configs/typescript.d.ts.map +1 -0
- package/dist/configs/typescript.js +12 -0
- package/dist/configs/typescript.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/types/configuration-type.d.ts +74 -0
- package/dist/types/configuration-type.d.ts.map +1 -0
- package/dist/types/configuration-type.js +2 -0
- package/dist/types/configuration-type.js.map +1 -0
- package/package.json +47 -20
- package/.editorconfig +0 -58
- package/.eslintrc.js +0 -17
- package/.github/workflows/ci.yml +0 -46
- package/.github/workflows/create-release.yml +0 -51
- package/.github/workflows/prepare-release.yml +0 -66
- package/CHANGELOG.md +0 -52
- package/index.js +0 -11
- package/rules/eslint.js +0 -75
- package/rules/import.js +0 -36
- package/rules/jsdoc.js +0 -25
- package/rules/next.js +0 -17
- package/rules/react-hooks.js +0 -10
- package/rules/react.js +0 -32
- package/rules/typescript.js +0 -214
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { config, configs } from "typescript-eslint";
|
|
2
|
+
const typescriptRules = config(configs.eslintRecommended, configs.recommended, configs.recommendedTypeChecked.map((rule) => ({
|
|
3
|
+
...rule,
|
|
4
|
+
files: ["**/*.ts", "**/*.tsx", "**/*.mts"], // We use TS config only for TS files
|
|
5
|
+
})), {
|
|
6
|
+
files: ["**/*.ts", "**/*.tsx", "**/*.mts"],
|
|
7
|
+
// This is required, see the docs
|
|
8
|
+
languageOptions: {
|
|
9
|
+
parserOptions: {
|
|
10
|
+
project: true,
|
|
11
|
+
parser: "@typescript-eslint/parser",
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
}, {
|
|
15
|
+
files: ["**/*.js", "**/*.jsx"],
|
|
16
|
+
rules: {
|
|
17
|
+
"@typescript-eslint/no-require-imports": "off",
|
|
18
|
+
},
|
|
19
|
+
}, {
|
|
20
|
+
files: ["**/*.ts", "**/*.tsx", "**/*.mts"], // We use TS config only for TS files
|
|
21
|
+
rules: {
|
|
22
|
+
"@typescript-eslint/no-misused-promises": [
|
|
23
|
+
"error",
|
|
24
|
+
{
|
|
25
|
+
checksVoidReturn: {
|
|
26
|
+
attributes: false,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
"@typescript-eslint/unbound-method": "off",
|
|
31
|
+
// https://github.com/typescript-eslint/typescript-eslint/issues/2621
|
|
32
|
+
"no-unused-vars": "off",
|
|
33
|
+
"@typescript-eslint/no-unused-vars": "error",
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
export default typescriptRules;
|
|
37
|
+
//# sourceMappingURL=typescript.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript.js","sourceRoot":"","sources":["../../../src/configs/providers/typescript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,eAAe,GAAG,MAAM,CAC5B,OAAO,CAAC,iBAAiB,EACzB,OAAO,CAAC,WAAW,EACnB,OAAO,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC5C,GAAG,IAAI;IACP,KAAK,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,CAAC,EAAE,qCAAqC;CAClF,CAAC,CAAC,EACH;IACE,KAAK,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,CAAC;IAE1C,iCAAiC;IACjC,eAAe,EAAE;QACf,aAAa,EAAE;YACb,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,2BAA2B;SACpC;KACF;CACF,EACD;IACE,KAAK,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC;IAC9B,KAAK,EAAE;QACL,uCAAuC,EAAE,KAAK;KAC/C;CACF,EACD;IACE,KAAK,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,CAAC,EAAE,qCAAqC;IACjF,KAAK,EAAE;QACL,wCAAwC,EAAE;YACxC,OAAO;YACP;gBACE,gBAAgB,EAAE;oBAChB,UAAU,EAAE,KAAK;iBAClB;aACF;SACF;QACD,mCAAmC,EAAE,KAAK;QAE1C,qEAAqE;QACrE,gBAAgB,EAAE,KAAK;QACvB,mCAAmC,EAAE,OAAO;KAC7C;CACF,CACF,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unicorn.d.ts","sourceRoot":"","sources":["../../../src/configs/providers/unicorn.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,YAAY,qEAiCjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import eslintPluginUnicorn from "eslint-plugin-unicorn";
|
|
2
|
+
import { config } from "typescript-eslint";
|
|
3
|
+
const unicornRules = config(eslintPluginUnicorn.configs["flat/recommended"], {
|
|
4
|
+
rules: {
|
|
5
|
+
"unicorn/prevent-abbreviations": "off",
|
|
6
|
+
"unicorn/filename-case": "off",
|
|
7
|
+
"unicorn/no-await-expression-member": "off",
|
|
8
|
+
"unicorn/prefer-node-protocol": "off",
|
|
9
|
+
"unicorn/prefer-global-this": "off",
|
|
10
|
+
"unicorn/consistent-function-scoping": "off",
|
|
11
|
+
"unicorn/prefer-query-selector": "off",
|
|
12
|
+
"unicorn/switch-case-braces": "off",
|
|
13
|
+
"unicorn/no-null": "off",
|
|
14
|
+
},
|
|
15
|
+
}, {
|
|
16
|
+
files: ["**/pages/**/*.page.tsx"],
|
|
17
|
+
rules: {
|
|
18
|
+
"unicorn/filename-case": ["error", { case: "kebabCase" }],
|
|
19
|
+
},
|
|
20
|
+
}, {
|
|
21
|
+
files: ["**/components/**/*.tsx"],
|
|
22
|
+
rules: {
|
|
23
|
+
"unicorn/filename-case": ["error", { case: "pascalCase" }],
|
|
24
|
+
},
|
|
25
|
+
}, {
|
|
26
|
+
files: ["**/*.js", "**/*.jsx"],
|
|
27
|
+
rules: {
|
|
28
|
+
"unicorn/prefer-module": "off",
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
export default unicornRules;
|
|
32
|
+
//# sourceMappingURL=unicorn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unicorn.js","sourceRoot":"","sources":["../../../src/configs/providers/unicorn.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,MAAM,YAAY,GAAG,MAAM,CACzB,mBAAmB,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAC/C;IACE,KAAK,EAAE;QACL,+BAA+B,EAAE,KAAK;QACtC,uBAAuB,EAAE,KAAK;QAC9B,oCAAoC,EAAE,KAAK;QAC3C,8BAA8B,EAAE,KAAK;QACrC,4BAA4B,EAAE,KAAK;QACnC,qCAAqC,EAAE,KAAK;QAC5C,+BAA+B,EAAE,KAAK;QACtC,4BAA4B,EAAE,KAAK;QACnC,iBAAiB,EAAE,KAAK;KACzB;CACF,EACD;IACE,KAAK,EAAE,CAAC,wBAAwB,CAAC;IACjC,KAAK,EAAE;QACL,uBAAuB,EAAE,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;KAC1D;CACF,EACD;IACE,KAAK,EAAE,CAAC,wBAAwB,CAAC;IACjC,KAAK,EAAE;QACL,uBAAuB,EAAE,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;KAC3D;CACF,EACD;IACE,KAAK,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC;IAC9B,KAAK,EAAE;QACL,uBAAuB,EAAE,KAAK;KAC/B;CACF,CACF,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-library.d.ts","sourceRoot":"","sources":["../../src/configs/react-library.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE,QAAA,MAAM,kBAAkB,EAAE,iBAYzB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const reactLibraryConfig = {
|
|
2
|
+
defaults: true,
|
|
3
|
+
esLintRecommended: true,
|
|
4
|
+
typescript: true,
|
|
5
|
+
unicorn: true,
|
|
6
|
+
reactRecommended: true,
|
|
7
|
+
reactJsxRuntime: true,
|
|
8
|
+
import: true,
|
|
9
|
+
reactHooks: true,
|
|
10
|
+
prettierRecommended: true,
|
|
11
|
+
jsdoc: true,
|
|
12
|
+
onlyError: true,
|
|
13
|
+
};
|
|
14
|
+
export default reactLibraryConfig;
|
|
15
|
+
//# sourceMappingURL=react-library.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-library.js","sourceRoot":"","sources":["../../src/configs/react-library.ts"],"names":[],"mappings":"AAEA,MAAM,kBAAkB,GAAsB;IAC5C,QAAQ,EAAE,IAAI;IACd,iBAAiB,EAAE,IAAI;IACvB,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE,IAAI;IACb,gBAAgB,EAAE,IAAI;IACtB,eAAe,EAAE,IAAI;IACrB,MAAM,EAAE,IAAI;IACZ,UAAU,EAAE,IAAI;IAChB,mBAAmB,EAAE,IAAI;IACzB,KAAK,EAAE,IAAI;IACX,SAAS,EAAE,IAAI;CAChB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../src/configs/typescript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE,QAAA,MAAM,YAAY,EAAE,iBASnB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const nextJsConfig = {
|
|
2
|
+
defaults: true,
|
|
3
|
+
esLintRecommended: true,
|
|
4
|
+
typescript: true,
|
|
5
|
+
unicorn: true,
|
|
6
|
+
import: true,
|
|
7
|
+
prettierRecommended: true,
|
|
8
|
+
jsdoc: true,
|
|
9
|
+
onlyError: true,
|
|
10
|
+
};
|
|
11
|
+
export default nextJsConfig;
|
|
12
|
+
//# sourceMappingURL=typescript.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript.js","sourceRoot":"","sources":["../../src/configs/typescript.ts"],"names":[],"mappings":"AAEA,MAAM,YAAY,GAAsB;IACtC,QAAQ,EAAE,IAAI;IACd,iBAAiB,EAAE,IAAI;IACvB,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE,IAAI;IACb,MAAM,EAAE,IAAI;IACZ,mBAAmB,EAAE,IAAI;IACzB,KAAK,EAAE,IAAI;IACX,SAAS,EAAE,IAAI;CAChB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type { ConfigurationType } from "./types/configuration-type.js";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
configs: {
|
|
4
|
+
flat: {
|
|
5
|
+
nextjs: import("@eslint/compat").FixupConfigArray;
|
|
6
|
+
javascript: import("@eslint/compat").FixupConfigArray;
|
|
7
|
+
cypress: import("@eslint/compat").FixupConfigArray;
|
|
8
|
+
"react-library": import("@eslint/compat").FixupConfigArray;
|
|
9
|
+
typescript: import("@eslint/compat").FixupConfigArray;
|
|
10
|
+
getConfig: (ruleConfig: import("./types/configuration-type.js").ConfigurationType) => import("@eslint/compat").FixupConfigArray;
|
|
11
|
+
defaults: {
|
|
12
|
+
nextjs: import("./types/configuration-type.js").ConfigurationType;
|
|
13
|
+
javascript: import("./types/configuration-type.js").ConfigurationType;
|
|
14
|
+
cypress: import("./types/configuration-type.js").ConfigurationType;
|
|
15
|
+
"react-library": import("./types/configuration-type.js").ConfigurationType;
|
|
16
|
+
typescript: import("./types/configuration-type.js").ConfigurationType;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAyBA,YAAY,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;;;;;;;;;;;;;;;;;;;;AACvE,wBAEE"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import nextjs from "./configs/nextjs.js";
|
|
2
|
+
import javascript from "./configs/javascript.js";
|
|
3
|
+
import cypress from "./configs/cypress.js";
|
|
4
|
+
import reactLibrary from "./configs/react-library.js";
|
|
5
|
+
import typescript from "./configs/typescript.js";
|
|
6
|
+
import getConfig from "./configs/get-config.js";
|
|
7
|
+
const configs = {
|
|
8
|
+
flat: {
|
|
9
|
+
nextjs: getConfig(nextjs),
|
|
10
|
+
javascript: getConfig(javascript),
|
|
11
|
+
cypress: getConfig(cypress),
|
|
12
|
+
"react-library": getConfig(reactLibrary),
|
|
13
|
+
typescript: getConfig(typescript),
|
|
14
|
+
getConfig,
|
|
15
|
+
defaults: {
|
|
16
|
+
nextjs,
|
|
17
|
+
javascript,
|
|
18
|
+
cypress,
|
|
19
|
+
"react-library": reactLibrary,
|
|
20
|
+
typescript,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
export default {
|
|
25
|
+
configs,
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,OAAO,UAAU,MAAM,yBAAyB,CAAC;AACjD,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAC3C,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,UAAU,MAAM,yBAAyB,CAAC;AACjD,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAEhD,MAAM,OAAO,GAAG;IACd,IAAI,EAAE;QACJ,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC;QACzB,UAAU,EAAE,SAAS,CAAC,UAAU,CAAC;QACjC,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC;QAC3B,eAAe,EAAE,SAAS,CAAC,YAAY,CAAC;QACxC,UAAU,EAAE,SAAS,CAAC,UAAU,CAAC;QACjC,SAAS;QACT,QAAQ,EAAE;YACR,MAAM;YACN,UAAU;YACV,OAAO;YACP,eAAe,EAAE,YAAY;YAC7B,UAAU;SACX;KACF;CACF,CAAC;AAGF,eAAe;IACb,OAAO;CACR,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ConfigurationType interface defines the structure of a configuration object.
|
|
3
|
+
*/
|
|
4
|
+
export type ConfigurationType = {
|
|
5
|
+
/**
|
|
6
|
+
* The default configuration for the linter. If set to true, it will use the default configuration.
|
|
7
|
+
*/
|
|
8
|
+
defaults?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* The recommended ESLint configuration. If set to true, it will use the recommended configuration.
|
|
11
|
+
*/
|
|
12
|
+
esLintRecommended?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* The recommended configuration for TypeScript. If set to true, it will use the recommended configuration.
|
|
15
|
+
*/
|
|
16
|
+
typescript?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The recommended configuration for unicorn. If set to true, it will use the recommended configuration.
|
|
19
|
+
*/
|
|
20
|
+
unicorn?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The recommended configuration for React. If set to true, it will use the recommended configuration.
|
|
23
|
+
*/
|
|
24
|
+
reactRecommended?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* The recommended configuration for React with JSX runtime. If set to true, it will use the recommended configuration.
|
|
27
|
+
*/
|
|
28
|
+
reactJsxRuntime?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* The recommended configuration for import rules. If set to true, it will use the recommended configuration.
|
|
31
|
+
*/
|
|
32
|
+
import?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* The recommended configuration for Prettier. If set to true, it will use the recommended configuration.
|
|
35
|
+
*/
|
|
36
|
+
prettierRecommended?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* The recommended configuration for Next.js. If set to true, it will use the recommended configuration.
|
|
39
|
+
*/
|
|
40
|
+
next?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* The recommended configuration for React hooks. If set to true, it will use the recommended configuration.
|
|
43
|
+
*/
|
|
44
|
+
reactHooks?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* The recommended configuration for Cypress. If set to true, it will use the recommended configuration.
|
|
47
|
+
*/
|
|
48
|
+
cypressRecommended?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* The recommended configuration for Jsdoc. If set to true, it will use the recommended configuration.
|
|
51
|
+
*/
|
|
52
|
+
jsdoc?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Enables the recommended configuration for Jsdoc with RequireJsdoc. If set to true, it will use the recommended configuration.
|
|
55
|
+
*/
|
|
56
|
+
jsdocRequireJsdoc?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* If set to true, it will only show errors in the linter output. This is useful for CI/CD pipelines where you only want to see errors and not warnings.
|
|
59
|
+
*/
|
|
60
|
+
onlyError?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* If set to true, it will prevent the use of "only"-tests.
|
|
63
|
+
*/
|
|
64
|
+
noOnlyTests?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* The recommended configuration for Jest. If set to true, it will use the recommended configuration.
|
|
67
|
+
*/
|
|
68
|
+
jest?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* The overrides for the configuration. This is useful for customizing the configuration for specific files or directories or rules.
|
|
71
|
+
*/
|
|
72
|
+
overrides?: import("typescript-eslint").InfiniteDepthConfigWithExtends;
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=configuration-type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configuration-type.d.ts","sourceRoot":"","sources":["../../src/types/configuration-type.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,mBAAmB,EAAE,8BAA8B,CAAC;CACxE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configuration-type.js","sourceRoot":"","sources":["../../src/types/configuration-type.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neolution-ch/eslint-config-neolution",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "This package provides Neolution's .eslintrc as an extensible shared config.",
|
|
5
5
|
"homepage": "https://github.com/neolution-ch/eslint-config-neolution",
|
|
6
|
-
"
|
|
6
|
+
"type": "module",
|
|
7
7
|
"exports": {
|
|
8
|
-
".": "./
|
|
8
|
+
"./package.json": "./package.json",
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"require": "./dist/index.js"
|
|
13
|
+
}
|
|
9
14
|
},
|
|
15
|
+
"main": "dist/index.js",
|
|
16
|
+
"types": "dist/index.d.ts",
|
|
17
|
+
"files": [
|
|
18
|
+
"dist/*"
|
|
19
|
+
],
|
|
10
20
|
"scripts": {
|
|
11
|
-
"
|
|
12
|
-
"
|
|
21
|
+
"lint": "yarn tsc && eslint --cache",
|
|
22
|
+
"prepack": "yarn tsc",
|
|
13
23
|
"upgradeAll": "npm-check-updates --packageFile ./package.json -u"
|
|
14
24
|
},
|
|
15
25
|
"repository": {
|
|
@@ -19,24 +29,41 @@
|
|
|
19
29
|
"license": "MIT",
|
|
20
30
|
"author": "Neolution",
|
|
21
31
|
"dependencies": {
|
|
22
|
-
"@
|
|
23
|
-
"@
|
|
24
|
-
"@
|
|
25
|
-
"eslint-config-
|
|
26
|
-
"eslint-import-resolver-typescript": "^3.
|
|
27
|
-
"eslint-plugin-
|
|
28
|
-
"eslint-plugin-
|
|
29
|
-
"eslint-plugin-
|
|
30
|
-
"eslint-plugin-
|
|
31
|
-
"eslint-plugin-
|
|
32
|
+
"@eslint/compat": "^1.2.5",
|
|
33
|
+
"@eslint/eslintrc": "^3.2.0",
|
|
34
|
+
"@next/eslint-plugin-next": "^15.1.4",
|
|
35
|
+
"eslint-config-prettier": "^10.0.1",
|
|
36
|
+
"eslint-import-resolver-typescript": "^3.7.0",
|
|
37
|
+
"eslint-plugin-cypress": "^4.1.0",
|
|
38
|
+
"eslint-plugin-import": "^2.31.0",
|
|
39
|
+
"eslint-plugin-jest": "^28.11.0",
|
|
40
|
+
"eslint-plugin-jsdoc": "^50.6.3",
|
|
41
|
+
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
42
|
+
"eslint-plugin-only-error": "^1.0.2",
|
|
43
|
+
"eslint-plugin-prettier": "^5.2.2",
|
|
44
|
+
"eslint-plugin-react": "^7.37.4",
|
|
45
|
+
"eslint-plugin-react-hooks": "^5.1.0",
|
|
46
|
+
"eslint-plugin-unicorn": "^56.0.1",
|
|
47
|
+
"typescript-eslint": "^8.20.0"
|
|
32
48
|
},
|
|
33
49
|
"peerDependencies": {
|
|
34
|
-
"eslint": "^
|
|
50
|
+
"eslint": "^9.0.0"
|
|
35
51
|
},
|
|
36
52
|
"devDependencies": {
|
|
37
|
-
"
|
|
38
|
-
"
|
|
53
|
+
"@eslint/js": "^9.18.0",
|
|
54
|
+
"@release-it/keep-a-changelog": "^6.0.0",
|
|
55
|
+
"@types/eslint-config-prettier": "^6.11.3",
|
|
56
|
+
"@types/eslint__eslintrc": "^2.1.2",
|
|
57
|
+
"eslint": "^9.18.0",
|
|
39
58
|
"npm-check-updates": "^16.3.8",
|
|
40
|
-
"
|
|
41
|
-
|
|
59
|
+
"prettier": "^3.4.2",
|
|
60
|
+
"release-it": "^18.1.2",
|
|
61
|
+
"tsx": "^4.19.2",
|
|
62
|
+
"typescript": "^5.7.3"
|
|
63
|
+
},
|
|
64
|
+
"publishConfig": {
|
|
65
|
+
"access": "public",
|
|
66
|
+
"registry": "https://registry.npmjs.org"
|
|
67
|
+
},
|
|
68
|
+
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
42
69
|
}
|
package/.editorconfig
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
# Neolution ❤ http://EditorConfig.org
|
|
2
|
-
|
|
3
|
-
# This file is the top-most EditorConfig file
|
|
4
|
-
root = true
|
|
5
|
-
|
|
6
|
-
# All Files
|
|
7
|
-
[*]
|
|
8
|
-
charset = utf-8
|
|
9
|
-
end_of_line = crlf
|
|
10
|
-
indent_style = space
|
|
11
|
-
#indent_size = 4
|
|
12
|
-
# (Please don't specify an indent_size here; that has too many unintended consequences.)
|
|
13
|
-
insert_final_newline = true
|
|
14
|
-
trim_trailing_whitespace = true
|
|
15
|
-
|
|
16
|
-
# Solution Files
|
|
17
|
-
[*.sln]
|
|
18
|
-
indent_size = 4
|
|
19
|
-
indent_style = tab
|
|
20
|
-
|
|
21
|
-
# XML Project Files
|
|
22
|
-
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj,njsproj}]
|
|
23
|
-
indent_size = 2
|
|
24
|
-
|
|
25
|
-
# Configuration Files
|
|
26
|
-
[*.{json,xml,yml,config,props,targets,nuspec,resx,ruleset}]
|
|
27
|
-
indent_size = 2
|
|
28
|
-
|
|
29
|
-
# .NET Config Files
|
|
30
|
-
[*.{config}]
|
|
31
|
-
indent_size = 2
|
|
32
|
-
charset = utf-8-bom
|
|
33
|
-
|
|
34
|
-
# Markdown Files
|
|
35
|
-
[*.md]
|
|
36
|
-
end_of_line = lf
|
|
37
|
-
trim_trailing_whitespace = false
|
|
38
|
-
|
|
39
|
-
# Web Files
|
|
40
|
-
[*.{htm,html,js,ts,css,scss,less}]
|
|
41
|
-
indent_size = 2
|
|
42
|
-
insert_final_newline = true
|
|
43
|
-
|
|
44
|
-
# Razor Files
|
|
45
|
-
[*.cshtml]
|
|
46
|
-
indent_size = 2
|
|
47
|
-
charset = utf-8-bom
|
|
48
|
-
|
|
49
|
-
# Bash Files
|
|
50
|
-
[*.sh]
|
|
51
|
-
indent_size = 4
|
|
52
|
-
end_of_line = lf
|
|
53
|
-
|
|
54
|
-
# Dotnet Code Files
|
|
55
|
-
[*.{cs,csx,cake,vb}]
|
|
56
|
-
indent_size = 4
|
|
57
|
-
insert_final_newline = true
|
|
58
|
-
charset = utf-8-bom
|
package/.eslintrc.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// Disable typescript rules
|
|
2
|
-
const typescriptOff = Object.keys(require('@typescript-eslint/eslint-plugin').rules)
|
|
3
|
-
.reduce((acc, rule) => { acc[`@typescript-eslint/${rule}`] = 'off'; return acc }, {})
|
|
4
|
-
|
|
5
|
-
module.exports = {
|
|
6
|
-
root: true,
|
|
7
|
-
env: {
|
|
8
|
-
es6: true,
|
|
9
|
-
node: true,
|
|
10
|
-
browser: true,
|
|
11
|
-
},
|
|
12
|
-
extends: ["@neolution-ch/eslint-config-neolution"],
|
|
13
|
-
parser: "espree", // restore original parser
|
|
14
|
-
rules: {
|
|
15
|
-
...typescriptOff
|
|
16
|
-
},
|
|
17
|
-
};
|
package/.github/workflows/ci.yml
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
workflow_dispatch:
|
|
5
|
-
pull_request:
|
|
6
|
-
branches: [main]
|
|
7
|
-
types: [opened, reopened, synchronize, ready_for_review]
|
|
8
|
-
|
|
9
|
-
# cancel running actions for current PR if new commits were pushed
|
|
10
|
-
concurrency:
|
|
11
|
-
group: ${{ github.workflow }}-${{ github.ref }}
|
|
12
|
-
cancel-in-progress: true
|
|
13
|
-
|
|
14
|
-
jobs:
|
|
15
|
-
build:
|
|
16
|
-
if: github.event.pull_request.draft == false
|
|
17
|
-
runs-on: ubuntu-latest
|
|
18
|
-
steps:
|
|
19
|
-
- uses: actions/checkout@v3
|
|
20
|
-
- uses: actions/setup-node@v3
|
|
21
|
-
with:
|
|
22
|
-
node-version: 18
|
|
23
|
-
cache: "yarn"
|
|
24
|
-
- run: yarn install --frozen-lockfile
|
|
25
|
-
- run: yarn lint
|
|
26
|
-
- run: yarn pack
|
|
27
|
-
|
|
28
|
-
check-changelog:
|
|
29
|
-
if: github.event.pull_request.draft == false
|
|
30
|
-
runs-on: ubuntu-latest
|
|
31
|
-
steps:
|
|
32
|
-
- uses: actions/checkout@v3
|
|
33
|
-
with:
|
|
34
|
-
fetch-depth: 0
|
|
35
|
-
|
|
36
|
-
- name: Get changed files
|
|
37
|
-
id: changed-files
|
|
38
|
-
uses: tj-actions/changed-files@v31
|
|
39
|
-
|
|
40
|
-
- name: Check if changelog was touched
|
|
41
|
-
run: |
|
|
42
|
-
changelogFound=$(echo ${{ steps.changed-files.outputs.all_changed_files }} | grep -ow "CHANGELOG.md" | wc -w)
|
|
43
|
-
if [ $changelogFound -eq 0 ]; then
|
|
44
|
-
echo '### :boom: Please update the changelog accordingly (https://keepachangelog.com)' >> $GITHUB_STEP_SUMMARY
|
|
45
|
-
exit 1
|
|
46
|
-
fi
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
name: Create Release
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
workflow_dispatch:
|
|
5
|
-
|
|
6
|
-
jobs:
|
|
7
|
-
create-github-release:
|
|
8
|
-
runs-on: ubuntu-latest
|
|
9
|
-
steps:
|
|
10
|
-
- name: Check out code
|
|
11
|
-
uses: actions/checkout@v3
|
|
12
|
-
|
|
13
|
-
- name: Initialize mandatory git config
|
|
14
|
-
run: |
|
|
15
|
-
git config user.name "GitHub Actions"
|
|
16
|
-
git config user.email noreply@github.com
|
|
17
|
-
|
|
18
|
-
- name: Setup release information
|
|
19
|
-
run: |
|
|
20
|
-
echo "PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g')" >> $GITHUB_ENV
|
|
21
|
-
|
|
22
|
-
- name: Extract release notes
|
|
23
|
-
id: extract_release_notes
|
|
24
|
-
uses: ffurrer2/extract-release-notes@v1
|
|
25
|
-
|
|
26
|
-
- name: Create Release
|
|
27
|
-
id: create_release
|
|
28
|
-
uses: actions/create-release@v1
|
|
29
|
-
env:
|
|
30
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
31
|
-
with:
|
|
32
|
-
tag_name: ${{ env.PACKAGE_VERSION }}
|
|
33
|
-
release_name: v${{ env.PACKAGE_VERSION }}
|
|
34
|
-
body: ${{ steps.extract_release_notes.outputs.release_notes }}
|
|
35
|
-
draft: false
|
|
36
|
-
prerelease: false
|
|
37
|
-
|
|
38
|
-
publish-npm:
|
|
39
|
-
runs-on: ubuntu-latest
|
|
40
|
-
steps:
|
|
41
|
-
- name: Check out code
|
|
42
|
-
uses: actions/checkout@v3
|
|
43
|
-
- uses: actions/setup-node@v3
|
|
44
|
-
with:
|
|
45
|
-
node-version: 18
|
|
46
|
-
cache: "yarn"
|
|
47
|
-
registry-url: "https://registry.npmjs.org"
|
|
48
|
-
- run: yarn install --frozen-lockfile
|
|
49
|
-
- run: yarn publish --access public
|
|
50
|
-
env:
|
|
51
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_NEOLUTION }}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
name: Prepare Release
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
workflow_dispatch:
|
|
5
|
-
inputs:
|
|
6
|
-
versionName:
|
|
7
|
-
description: "Name of version (ie 5.5.0)"
|
|
8
|
-
required: true
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
prepare-release:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
steps:
|
|
14
|
-
- name: Check out code
|
|
15
|
-
uses: actions/checkout@v2
|
|
16
|
-
|
|
17
|
-
- name: Check the input version
|
|
18
|
-
run: |
|
|
19
|
-
versionNumber=${{ github.event.inputs.versionName }}
|
|
20
|
-
|
|
21
|
-
if [[ $versionNumber =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$ ]]; then
|
|
22
|
-
echo '### :rocket: Preparing the release!' >> $GITHUB_STEP_SUMMARY
|
|
23
|
-
else
|
|
24
|
-
echo '### :boom: Please supply valid version according to the [Semantic Versioning](https://semver.org/) scheme.' >> $GITHUB_STEP_SUMMARY
|
|
25
|
-
exit 1
|
|
26
|
-
fi
|
|
27
|
-
|
|
28
|
-
- name: Create release branch
|
|
29
|
-
run: git checkout -b release/v${{ github.event.inputs.versionName }}
|
|
30
|
-
|
|
31
|
-
- name: Initialize mandatory git config
|
|
32
|
-
run: |
|
|
33
|
-
git config user.name "GitHub Actions"
|
|
34
|
-
git config user.email noreply@github.com
|
|
35
|
-
|
|
36
|
-
- name: Change version number and name
|
|
37
|
-
run: yarn version --no-git-tag-version --no-commit-hook --new-version ${{ github.event.inputs.versionName }}
|
|
38
|
-
|
|
39
|
-
- name: Update Changelog
|
|
40
|
-
uses: thomaseizinger/keep-a-changelog-new-release@v1
|
|
41
|
-
with:
|
|
42
|
-
version: ${{ github.event.inputs.versionName }}
|
|
43
|
-
|
|
44
|
-
- name: Commit changelog and manifest files
|
|
45
|
-
id: make-commit
|
|
46
|
-
run: |
|
|
47
|
-
git add package.json
|
|
48
|
-
git add CHANGELOG.md
|
|
49
|
-
git commit --message "Prepare release ${{ github.event.inputs.versionName }}"
|
|
50
|
-
echo "::set-output name=commit::$(git rev-parse HEAD)"
|
|
51
|
-
|
|
52
|
-
- name: Push new branch
|
|
53
|
-
run: git push origin release/v${{ github.event.inputs.versionName }}
|
|
54
|
-
|
|
55
|
-
- name: Create pull request into main
|
|
56
|
-
uses: thomaseizinger/create-pull-request@1.0.0
|
|
57
|
-
with:
|
|
58
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
59
|
-
head: release/v${{ github.event.inputs.versionName }}
|
|
60
|
-
base: main
|
|
61
|
-
title: v${{ github.event.inputs.versionName }} into main
|
|
62
|
-
reviewers: ${{ github.event.issue.user.login }}
|
|
63
|
-
body: |
|
|
64
|
-
Hi!
|
|
65
|
-
This PR was created in response workflow running.
|
|
66
|
-
I've updated the version name and code commit: ${{ steps.make-commit.outputs.commit }}.
|