@dvukovic/style-guide 0.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.
Files changed (54) hide show
  1. package/.eslintrc.js +26 -0
  2. package/.github/workflows/defalt.yml +49 -0
  3. package/.prettierignore +1 -0
  4. package/.prettierrc.js +4 -0
  5. package/.release-it.json +15 -0
  6. package/.stylelintrc.js +4 -0
  7. package/.yarnrc.yml +1 -0
  8. package/CHANGELOG.md +8 -0
  9. package/README.md +5 -0
  10. package/cspell.config.js +17 -0
  11. package/package.json +67 -0
  12. package/src/__tests__/Dockerfile +8 -0
  13. package/src/__tests__/component.tsx +14 -0
  14. package/src/__tests__/db.sql +4 -0
  15. package/src/__tests__/schema.prisma +14 -0
  16. package/src/__tests__/script.js +6 -0
  17. package/src/__tests__/script.sh +3 -0
  18. package/src/__tests__/script.test.js +13 -0
  19. package/src/__tests__/structure.xml +7 -0
  20. package/src/__tests__/style.css +74 -0
  21. package/src/__tests__/typed.ts +5 -0
  22. package/src/cspell/base.txt +73 -0
  23. package/src/eslint/configs/core.js +14 -0
  24. package/src/eslint/configs/jest.js +4 -0
  25. package/src/eslint/configs/mobx.js +4 -0
  26. package/src/eslint/configs/next.js +4 -0
  27. package/src/eslint/configs/node.js +4 -0
  28. package/src/eslint/configs/react-typescript.js +6 -0
  29. package/src/eslint/configs/react.js +4 -0
  30. package/src/eslint/plugins/eslint-comments.js +19 -0
  31. package/src/eslint/plugins/eslint.js +153 -0
  32. package/src/eslint/plugins/etc.js +16 -0
  33. package/src/eslint/plugins/import-x.js +31 -0
  34. package/src/eslint/plugins/jest-formatting.js +13 -0
  35. package/src/eslint/plugins/jest.js +54 -0
  36. package/src/eslint/plugins/mobx.js +9 -0
  37. package/src/eslint/plugins/n.js +33 -0
  38. package/src/eslint/plugins/next.js +28 -0
  39. package/src/eslint/plugins/promise.js +27 -0
  40. package/src/eslint/plugins/react-hooks.js +7 -0
  41. package/src/eslint/plugins/react.js +106 -0
  42. package/src/eslint/plugins/security-node.js +31 -0
  43. package/src/eslint/plugins/sonarjs.js +33 -0
  44. package/src/eslint/plugins/typescript-eslint.js +183 -0
  45. package/src/eslint/plugins/unicorn.js +155 -0
  46. package/src/eslint/plugins/unused-imports.js +7 -0
  47. package/src/prettier/configs/core.js +19 -0
  48. package/src/prettier/plugins/embed.js +8 -0
  49. package/src/prettier/plugins/prettier.js +23 -0
  50. package/src/prettier/plugins/sql.js +9 -0
  51. package/src/stylelint/configs/core.js +16 -0
  52. package/src/stylelint/plugins/order.js +19 -0
  53. package/src/stylelint/plugins/stylelint.js +93 -0
  54. package/tsconfig.json +13 -0
package/.eslintrc.js ADDED
@@ -0,0 +1,26 @@
1
+ /** @type {import("@types/eslint").ESLint.ConfigData} */
2
+ module.exports = {
3
+ root: true,
4
+ parser: "@typescript-eslint/parser",
5
+ ignorePatterns: ["node_modules"],
6
+ extends: [
7
+ "./src/eslint/configs/core.js",
8
+ "./src/eslint/configs/node.js",
9
+ "./src/eslint/configs/mobx.js",
10
+ "./src/eslint/configs/react.js",
11
+ "./src/eslint/configs/next.js",
12
+ ],
13
+ parserOptions: {
14
+ project: "./tsconfig.json",
15
+ },
16
+ overrides: [
17
+ {
18
+ files: ["*.ts", ".js"],
19
+ extends: ["./src/eslint/configs/react-typescript.js"],
20
+ },
21
+ {
22
+ files: ["*.test.ts", "*.test.js"],
23
+ extends: ["./src/eslint/configs/jest.js"],
24
+ },
25
+ ],
26
+ }
@@ -0,0 +1,49 @@
1
+ name: Default
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ workflow_dispatch:
9
+
10
+ jobs:
11
+ lint:
12
+ name: Lint
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - name: Enable Corepack
16
+ run: corepack enable
17
+ - uses: actions/checkout@v4
18
+ - uses: actions/setup-node@v4
19
+ with:
20
+ registry-url: "https://registry.npmjs.org"
21
+ node-version: 20.x
22
+ cache: yarn
23
+ - run: yarn
24
+ - run: yarn lint
25
+
26
+ release:
27
+ name: Release
28
+ needs: [lint]
29
+ if: github.ref == 'refs/heads/master'
30
+ runs-on: ubuntu-latest
31
+ steps:
32
+ - name: Enable Corepack
33
+ run: corepack enable
34
+ - uses: actions/checkout@v4
35
+ - uses: actions/setup-node@v4
36
+ with:
37
+ registry-url: "https://registry.npmjs.org"
38
+ node-version: 20.x
39
+ cache: yarn
40
+ - name: git config
41
+ run: |
42
+ git config user.name "${GITHUB_ACTOR}"
43
+ git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
44
+ - run: yarn
45
+ - run: yarn release --ci
46
+ env:
47
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
48
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
49
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1 @@
1
+ CHANGELOG.md
package/.prettierrc.js ADDED
@@ -0,0 +1,4 @@
1
+ /** @type {import("prettier").Config} */
2
+ module.exports = {
3
+ ...require("./src/prettier/configs/core"),
4
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://unpkg.com/release-it/schema/release-it.json",
3
+ "github": {
4
+ "release": true
5
+ },
6
+ "plugins": {
7
+ "@release-it/conventional-changelog": {
8
+ "infile": "CHANGELOG.md",
9
+ "header": "# Changelog",
10
+ "preset": {
11
+ "name": "conventionalcommits"
12
+ }
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,4 @@
1
+ /** @type {import("stylelint").Config} */
2
+ module.exports = {
3
+ extends: ["./src/stylelint/configs/core.js"],
4
+ }
package/.yarnrc.yml ADDED
@@ -0,0 +1 @@
1
+ nodeLinker: node-modules
package/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0 (2024-07-26)
4
+
5
+
6
+ ### Features
7
+
8
+ * add release it changelog plugin ([2fcb601](https://github.com/vuki656/style-guide/commit/2fcb601483fb4365b7e9a4fd96fa33eaa9679b0f))
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # Style Guide
2
+
3
+ ## Prettier
4
+
5
+ Add `"lint:prettier": "prettier --log-level=warn --check .",` to scripts
@@ -0,0 +1,17 @@
1
+ /** @type {import("cspell").FileSettings} */
2
+ module.exports = {
3
+ useGitignore: true,
4
+ cache: {
5
+ useCache: true,
6
+ cacheLocation: "./node_modules/.cache/cspell",
7
+ },
8
+ dictionaryDefinitions: [
9
+ {
10
+ name: "shared",
11
+ path: "./src/cspell/base.txt",
12
+ },
13
+ ],
14
+ caseSensitive: false,
15
+ ignorePaths: ["./src/cspell/base.txt"],
16
+ dictionaries: ["shared"],
17
+ }
package/package.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "@dvukovic/style-guide",
3
+ "scripts": {
4
+ "lint": "yarn lint:prettier && yarn lint:eslint && yarn lint:stylelint && yarn lint:spell",
5
+ "lint:eslint": "eslint . --ext .js,.ts,.tsx",
6
+ "lint:fix": "yarn lint:prettier --write && yarn lint:stylelint --fix && yarn lint:eslint --fix",
7
+ "lint:prettier": "prettier --log-level=warn --check .",
8
+ "lint:spell": "cspell --no-progress --no-summary --unique '**'",
9
+ "lint:stylelint": "stylelint ./**/*.css",
10
+ "release": "release-it"
11
+ },
12
+ "dependencies": {
13
+ "@eslint-community/eslint-plugin-eslint-comments": "^4.3.0",
14
+ "@next/eslint-plugin-next": "^14.2.5",
15
+ "@prettier/plugin-xml": "^3.4.1",
16
+ "@typescript-eslint/parser": "^7.17.0",
17
+ "eslint-plugin-etc": "^2.0.3",
18
+ "eslint-plugin-import-x": "^3.1.0",
19
+ "eslint-plugin-jest": "^28.6.0",
20
+ "eslint-plugin-jest-formatting": "^3.1.0",
21
+ "eslint-plugin-mobx": "^0.0.10",
22
+ "eslint-plugin-n": "^17.9.0",
23
+ "eslint-plugin-promise": "^7.0.0",
24
+ "eslint-plugin-react": "^7.35.0",
25
+ "eslint-plugin-react-hooks": "^4.6.2",
26
+ "eslint-plugin-security-node": "^1.1.4",
27
+ "eslint-plugin-sonarjs": "^1.0.4",
28
+ "eslint-plugin-unicorn": "^54.0.0",
29
+ "eslint-plugin-unused-imports": "^4.0.1",
30
+ "prettier-plugin-embed": "^0.4.15",
31
+ "prettier-plugin-jsdoc": "^1.3.0",
32
+ "prettier-plugin-packagejson": "^2.5.1",
33
+ "prettier-plugin-prisma": "^5.0.0",
34
+ "prettier-plugin-sh": "^0.14.0",
35
+ "prettier-plugin-sql": "^0.18.1",
36
+ "stylelint-order": "^6.0.4",
37
+ "typescript-eslint": "^7.17.0"
38
+ },
39
+ "devDependencies": {
40
+ "@release-it/conventional-changelog": "^8.0.1",
41
+ "@total-typescript/tsconfig": "^1.0.4",
42
+ "@types/eslint": "^8.56.11",
43
+ "@types/jest": "^29.5.12",
44
+ "@types/node": "^20.14.12",
45
+ "@types/react": "^18.3.3",
46
+ "cspell": "^8.12.1",
47
+ "eslint": "^8.57.0",
48
+ "jest": "^29.7.0",
49
+ "prettier": "^3.3.3",
50
+ "react": "^18.3.1",
51
+ "release-it": "^17.6.0",
52
+ "stylelint": "^16.7.0",
53
+ "typescript": "^5.5.4"
54
+ },
55
+ "peerDependencies": {
56
+ "cspell": "8",
57
+ "eslint": "8.57",
58
+ "prettier": "3",
59
+ "stylelint": "16"
60
+ },
61
+ "packageManager": "yarn@4.3.1",
62
+ "publishConfig": {
63
+ "access": "public",
64
+ "registry": "https://registry.npmjs.org"
65
+ },
66
+ "version": "0.1.0"
67
+ }
@@ -0,0 +1,8 @@
1
+ # Base Stage
2
+ FROM node:20.12.0-alpine AS base
3
+
4
+ RUN yarn workspaces focus --production --all
5
+
6
+ ENV WORKSPACE=${WORKSPACE}
7
+
8
+ CMD yarn workspace $WORKSPACE start
@@ -0,0 +1,14 @@
1
+ import React from "react"
2
+
3
+ export const Test = () => {
4
+ const foo = {
5
+ bar: 1,
6
+ }
7
+
8
+ return (
9
+ <>
10
+ <div>{foo.bar === 3 ? foo.bar : null}</div>
11
+ <div />
12
+ </>
13
+ )
14
+ }
@@ -0,0 +1,4 @@
1
+ SELECT
2
+ *
3
+ FROM
4
+ "table"
@@ -0,0 +1,14 @@
1
+ generator client {
2
+ provider = "prisma-client-js"
3
+ }
4
+
5
+ datasource db {
6
+ provider = "postgresql"
7
+ url = ""
8
+ }
9
+
10
+ model Site {
11
+ id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
12
+ name String
13
+ address String
14
+ }
@@ -0,0 +1,6 @@
1
+ const value = Date.now() - 30
2
+ let some = Date.now()
3
+
4
+ if (value === some) {
5
+ some = "test"
6
+ }
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+
3
+ echo "Hello world"
@@ -0,0 +1,13 @@
1
+ describe("This", () => {
2
+ it("should test that", () => {
3
+ expect(1).toBe(3)
4
+ })
5
+
6
+ it("should test", () => {
7
+ expect(1).toBe(1)
8
+ })
9
+
10
+ it("should test another", () => {
11
+ expect(1).toBe(2)
12
+ })
13
+ })
@@ -0,0 +1,7 @@
1
+ <note>
2
+ <script />
3
+ <to>Tove</to>
4
+ <from>Jani</from>
5
+ <heading>Reminder</heading>
6
+ <body>Don't forget me this weekend!</body>
7
+ </note>
@@ -0,0 +1,74 @@
1
+ :root {
2
+ --orange-1: #ffa500;
3
+ --yellow-1: #f9b916;
4
+ --black: #000000;
5
+ --gray-1: #c6c6c6;
6
+ --gray-2: #515151;
7
+ --gray-3: #e5e5e5;
8
+ --gray-4: #f2f4f4;
9
+ --gray-5: #767676;
10
+ --green-1: #2aa83f;
11
+ --blue-1: #307cff;
12
+ --pink-1: #f6eeff;
13
+ --purple-1: #be16f9;
14
+ --purple-2: #7e30f5;
15
+ --purple-3: #312665;
16
+ --purple-4: #f6eeff;
17
+ --red-1: #fc3e1c;
18
+ --white: #ffffff;
19
+ --shadow-1: 0 4px 4px 0 rgb(0 0 0 / 8%);
20
+ }
21
+
22
+ .container {
23
+ display: flex;
24
+ flex-direction: column;
25
+ padding: 25px;
26
+ row-gap: 23px;
27
+ width: 100%;
28
+ }
29
+
30
+ .title {
31
+ font-size: 1.25rem;
32
+ font-weight: 500;
33
+ }
34
+
35
+ .infoContainer {
36
+ font-weight: 400;
37
+ }
38
+
39
+ .infoLink {
40
+ color: var(--gray-2);
41
+ text-decoration: underline;
42
+ }
43
+
44
+ .header {
45
+ align-items: center;
46
+ display: flex;
47
+ justify-content: space-between;
48
+ }
49
+
50
+ .headerLeftSection {
51
+ align-items: center;
52
+ column-gap: 20px;
53
+ display: flex;
54
+ justify-content: flex-start;
55
+ }
56
+
57
+ .map {
58
+ height: 550px;
59
+ width: 100%;
60
+ }
61
+
62
+ .mapContainer {
63
+ background-color: var(--white);
64
+ padding: 13px;
65
+ }
66
+
67
+ .itemsContainer {
68
+ background-color: var(--white);
69
+ min-height: 200px;
70
+ }
71
+
72
+ a {
73
+ color: #ffffff;
74
+ }
@@ -0,0 +1,5 @@
1
+ export const file = {
2
+ greet: (): string => {
3
+ return "hi"
4
+ },
5
+ }
@@ -0,0 +1,73 @@
1
+ rimac
2
+ highcharts
3
+ tabler
4
+ bbox
5
+ typecheck
6
+ dataseries
7
+ corepack
8
+ toastify
9
+ eslintconfigpath
10
+ tweens
11
+ hookz
12
+ prepending
13
+ popperjs
14
+ tweenjs
15
+ autorun
16
+ keycloak
17
+ eslintcache
18
+ nextjs
19
+ mqtt
20
+ hookform
21
+ mkcert
22
+ uplot
23
+ preconnect
24
+ dedupe
25
+ autostream
26
+ pinst
27
+ titillium
28
+ nvmrc
29
+ releaserc
30
+ yarnrc
31
+ packagerc
32
+ loglevel
33
+ stylelint
34
+ stylelintcache
35
+ stylelintrc
36
+ quantico
37
+ dockerignore
38
+ commitlint
39
+ typesafe
40
+ pininfarina
41
+ supercluster
42
+ rimac
43
+ automobili
44
+ comlink
45
+ mapbox
46
+ cooldown
47
+ battista
48
+ webp
49
+ lcov
50
+ testlog
51
+ rgba
52
+ classname
53
+ dvukovic
54
+ sonarjs
55
+ datasource
56
+ dbgenerated
57
+ unspaced
58
+ packagejson
59
+ tove
60
+ jani
61
+ nonconstructor
62
+ nonoctal
63
+ polyfillio
64
+ multilines
65
+ textnodes
66
+ setstate
67
+ exrpress
68
+ nosql
69
+ multiplestatements
70
+ httpsrequest
71
+ missconfiguration
72
+ mischeck
73
+ descriptionless
@@ -0,0 +1,14 @@
1
+ /** @type {import("@types/eslint").ESLint.ConfigData} */
2
+ module.exports = {
3
+ extends: [
4
+ "../plugins/eslint.js",
5
+ "../plugins/typescript-eslint.js",
6
+ "../plugins/eslint-comments.js",
7
+ "../plugins/promise.js",
8
+ "../plugins/unicorn.js",
9
+ "../plugins/unused-imports.js",
10
+ "../plugins/import-x.js",
11
+ "../plugins/sonarjs.js",
12
+ "../plugins/etc.js",
13
+ ],
14
+ }
@@ -0,0 +1,4 @@
1
+ /** @type {import("@types/eslint").ESLint.ConfigData} */
2
+ module.exports = {
3
+ extends: ["../plugins/jest.js", "../plugins/jest-formatting.js"],
4
+ }
@@ -0,0 +1,4 @@
1
+ /** @type {import("@types/eslint").ESLint.ConfigData} */
2
+ module.exports = {
3
+ extends: ["../plugins/mobx.js"],
4
+ }
@@ -0,0 +1,4 @@
1
+ /** @type {import("@types/eslint").ESLint.ConfigData} */
2
+ module.exports = {
3
+ extends: ["../plugins/next.js"],
4
+ }
@@ -0,0 +1,4 @@
1
+ /** @type {import("@types/eslint").ESLint.ConfigData} */
2
+ module.exports = {
3
+ extends: ["../plugins/n.js", "../plugins/security-node.js"],
4
+ }
@@ -0,0 +1,6 @@
1
+ /** @type {import("@types/eslint").ESLint.ConfigData} */
2
+ module.exports = {
3
+ rules: {
4
+ "@typescript-eslint/explicit-module-boundary-types": "error",
5
+ },
6
+ }
@@ -0,0 +1,4 @@
1
+ /** @type {import("@types/eslint").ESLint.ConfigData} */
2
+ module.exports = {
3
+ extends: ["../plugins/react.js", "../plugins/react-hooks.js"],
4
+ }
@@ -0,0 +1,19 @@
1
+ /** @type {import("@types/eslint").ESLint.ConfigData} */
2
+ module.exports = {
3
+ plugins: ["@eslint-community/eslint-comments"],
4
+ rules: {
5
+ "@eslint-community/eslint-comments/disable-enable-pair": [
6
+ "error",
7
+ { allowWholeFile: true },
8
+ ],
9
+ "@eslint-community/eslint-comments/no-aggregating-enable": "error",
10
+ "@eslint-community/eslint-comments/no-duplicate-disable": "error",
11
+ "@eslint-community/eslint-comments/no-unlimited-disable": "error",
12
+ "@eslint-community/eslint-comments/no-unused-disable": "error",
13
+ "@eslint-community/eslint-comments/no-unused-enable": "error",
14
+ "@eslint-community/eslint-comments/require-description": [
15
+ "error",
16
+ { ignore: [] },
17
+ ],
18
+ },
19
+ }