@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
@@ -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,3 @@
1
+ declare const reactLibraryConfig: ConfigurationType;
2
+ export default reactLibraryConfig;
3
+ //# sourceMappingURL=react-library.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-library.d.ts","sourceRoot":"","sources":["../../src/configs/react-library.ts"],"names":[],"mappings":"AAAA,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":"AAAA,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,3 @@
1
+ declare const nextJsConfig: ConfigurationType;
2
+ export default nextJsConfig;
3
+ //# sourceMappingURL=typescript.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../src/configs/typescript.ts"],"names":[],"mappings":"AAAA,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":"AAAA,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"}
@@ -0,0 +1,21 @@
1
+ declare const _default: {
2
+ configs: {
3
+ flat: {
4
+ nextjs: import("@eslint/compat").FixupConfigArray;
5
+ javascript: import("@eslint/compat").FixupConfigArray;
6
+ cypress: import("@eslint/compat").FixupConfigArray;
7
+ "react-library": import("@eslint/compat").FixupConfigArray;
8
+ typescript: import("@eslint/compat").FixupConfigArray;
9
+ getConfig: (ruleConfig: ConfigurationType) => import("@eslint/compat").FixupConfigArray;
10
+ defaults: {
11
+ nextjs: ConfigurationType;
12
+ javascript: ConfigurationType;
13
+ cypress: ConfigurationType;
14
+ "react-library": ConfigurationType;
15
+ typescript: ConfigurationType;
16
+ };
17
+ };
18
+ };
19
+ };
20
+ export default _default;
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAyBA,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;AAEF,eAAe;IACb,OAAO;CACR,CAAC"}
package/package.json CHANGED
@@ -1,15 +1,25 @@
1
1
  {
2
2
  "name": "@neolution-ch/eslint-config-neolution",
3
- "version": "1.2.0",
3
+ "version": "2.0.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
- "main": "index.js",
6
+ "type": "module",
7
7
  "exports": {
8
- ".": "./index.js"
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
- "prelint": "git ls-files | xargs eclint check",
12
- "lint": "eslint \"**/*.js\" --cache --max-warnings 0",
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,40 @@
19
29
  "license": "MIT",
20
30
  "author": "Neolution",
21
31
  "dependencies": {
22
- "@next/eslint-plugin-next": "^12.3.1",
23
- "@typescript-eslint/eslint-plugin": "^5.39.0",
24
- "@typescript-eslint/parser": "^5.39.0",
25
- "eslint-config-airbnb": "^19.0.4",
26
- "eslint-import-resolver-typescript": "^3.5.1",
27
- "eslint-plugin-import": "^2.26.0",
28
- "eslint-plugin-jsdoc": "^39.3.6",
29
- "eslint-plugin-jsx-a11y": "^6.6.1",
30
- "eslint-plugin-react": "^7.31.8",
31
- "eslint-plugin-react-hooks": "^4.6.0"
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-jsdoc": "^50.6.3",
40
+ "eslint-plugin-no-only-tests": "^3.3.0",
41
+ "eslint-plugin-only-error": "^1.0.2",
42
+ "eslint-plugin-prettier": "^5.2.2",
43
+ "eslint-plugin-react": "^7.37.4",
44
+ "eslint-plugin-react-hooks": "^5.1.0",
45
+ "eslint-plugin-unicorn": "^56.0.1",
46
+ "typescript-eslint": "^8.20.0"
32
47
  },
33
48
  "peerDependencies": {
34
- "eslint": "^8.20.0"
49
+ "eslint": "^9.0.0"
35
50
  },
36
51
  "devDependencies": {
37
- "eclint": "^2.8.1",
38
- "eslint": "^8.24.0",
52
+ "@eslint/js": "^9.18.0",
53
+ "@release-it/keep-a-changelog": "^6.0.0",
54
+ "@types/eslint-config-prettier": "^6.11.3",
55
+ "@types/eslint__eslintrc": "^2.1.2",
56
+ "eslint": "^9.18.0",
39
57
  "npm-check-updates": "^16.3.8",
40
- "typescript": "^4.8.4"
41
- }
58
+ "prettier": "^3.4.2",
59
+ "release-it": "^18.1.2",
60
+ "tsx": "^4.19.2",
61
+ "typescript": "^5.7.3"
62
+ },
63
+ "publishConfig": {
64
+ "access": "public",
65
+ "registry": "https://registry.npmjs.org"
66
+ },
67
+ "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
42
68
  }
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
- };
@@ -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 }}.
package/CHANGELOG.md DELETED
@@ -1,44 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [Unreleased]
9
-
10
- ## [1.2.0] - 2022-10-27
11
-
12
- ### Added
13
-
14
- - Added typescript to the import/resolver
15
- - Added deprecated React types to the "ban-types" rule
16
- - Added "complexity" rule with a maximum of 20
17
- - Added "max-lines" rule with a maximum of 300 lines
18
-
19
- ### Changed
20
-
21
- - Updated "no-empty-function" rule to not allow any empty function
22
- - Updated "quotes" rule by using the typescript version
23
- - Updated "react/no-unstable-nested-components" rule to allow component creation inside component props
24
-
25
- ## [1.1.0] - 2022-10-17
26
-
27
- ### Added
28
-
29
- - Added MIT license
30
- - Enable react-hooks rules
31
-
32
- ## [1.0.0] - 2022-10-06
33
-
34
- ### Added
35
-
36
- - Initial release
37
-
38
- [Unreleased]: https://github.com/neolution-ch/eslint-config-neolution/compare/1.2.0...HEAD
39
-
40
- [1.2.0]: https://github.com/neolution-ch/eslint-config-neolution/compare/1.1.0...1.2.0
41
-
42
- [1.1.0]: https://github.com/neolution-ch/eslint-config-neolution/compare/1.0.0...1.1.0
43
-
44
- [1.0.0]: https://github.com/neolution-ch/eslint-config-neolution/compare/5f308ef87fa2a779e56cb6af4510baf6e2deeb23...1.0.0
package/index.js DELETED
@@ -1,11 +0,0 @@
1
- module.exports = {
2
- extends: [
3
- "./rules/eslint",
4
- "./rules/typescript",
5
- "./rules/import",
6
- "./rules/jsdoc",
7
- "./rules/react",
8
- "./rules/react-hooks",
9
- "./rules/next",
10
- ].map(require.resolve)
11
- };
package/rules/eslint.js DELETED
@@ -1,75 +0,0 @@
1
- module.exports = {
2
- extends: [
3
- "eslint-config-airbnb",
4
- ].map(require.resolve),
5
-
6
- // View link below for eslint rules documentation
7
- // https://eslint.org/docs/rules/
8
- rules: {
9
- // The airbnb config enforce that class methods use "this", but requires changing how you call the method
10
- // https://eslint.org/docs/rules/class-methods-use-this
11
- "class-methods-use-this": "off",
12
-
13
- // The airbnb config disables the complexity, but we want to limit it
14
- // https://eslint.org/docs/rules/complexity
15
- complexity: ["error", 20],
16
-
17
- // The airbnb config enforces consistent return, but we got problems with some external libraries, TypeScript enforces this anyway
18
- // https://eslint.org/docs/rules/consistent-return
19
- "consistent-return": "off",
20
-
21
- // The airbnb config forces unix style, but somebody also works on windows
22
- // https://eslint.org/docs/rules/linebreak-style
23
- "linebreak-style": "off",
24
-
25
- // The airbnb config limits to 100 ignoring some lines, instad we allow 160 but don't ignore lines
26
- // https://eslint.org/docs/rules/max-len
27
- "max-len": ["error", 160, 2, {
28
- ignoreComments: false,
29
- ignoreTrailingComments: false,
30
- ignoreUrls: false,
31
- ignoreStrings: false,
32
- ignoreTemplateLiterals: false,
33
- ignoreRegExpLiterals: false,
34
- }],
35
-
36
- // The airbnb disables the max lines, but we want to limit it
37
- // https://eslint.org/docs/rules/max-lines
38
- "max-lines": ["error", {
39
- max: 300,
40
- skipBlankLines: true,
41
- skipComments: true
42
- }],
43
-
44
- // The airbnb config disallow await inside of loops, but it cannot always be avoided
45
- // https://eslint.org/docs/rules/no-await-in-loop
46
- "no-await-in-loop": "off",
47
-
48
- // The airbnb config disallow use of the continue statement, but it's ok to have it
49
- // https://eslint.org/docs/rules/no-continue
50
- "no-continue": "off",
51
-
52
- // The airbnb config disallow use of unary operators (++ and --), but it's ok to have them
53
- // https://eslint.org/docs/rules/no-plusplus
54
- "no-plusplus": "off",
55
-
56
- // The airbnb config also restrict ForOfStatement, but we want to use it
57
- // https://eslint.org/docs/rules/no-restricted-syntax
58
- "no-restricted-syntax": [
59
- "error",
60
- {
61
- selector: "ForInStatement",
62
- message: "for..in loops iterate over the entire prototype chain, which is virtually never what you want. "
63
- +"Use Object.{keys,values,entries}, and iterate over the resulting array.",
64
- },
65
- {
66
- selector: "LabeledStatement",
67
- message: "Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.",
68
- },
69
- {
70
- selector: "WithStatement",
71
- message: "`with` is disallowed in strict mode because it makes code impossible to predict and optimize.",
72
- },
73
- ],
74
- },
75
- };
package/rules/import.js DELETED
@@ -1,36 +0,0 @@
1
- module.exports = {
2
- extends: [
3
- "plugin:import/recommended"
4
- ],
5
-
6
- plugins: [
7
- "import",
8
- ],
9
-
10
- settings: {
11
- "import/resolver": {
12
- node: {
13
- extensions: [".js", ".jsx", ".ts", ".tsx"],
14
- },
15
- typescript: {
16
- alwaysTryTypes: true,
17
- },
18
- },
19
- },
20
-
21
- // View link below for import rules documentation
22
- // https://github.com/import-js/eslint-plugin-import/tree/main/docs/rules
23
- rules: {
24
- // same as airbnb but with ts/tsx extensions
25
- "import/extensions": [
26
- "error",
27
- "ignorePackages",
28
- {
29
- js: "never",
30
- jsx: "never",
31
- ts: "never",
32
- tsx: "never"
33
- }
34
- ]
35
- },
36
- };