diff --git a/.eslintrc.js b/.eslintrc.js index d11f6f9..5f26ed5 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -82,35 +82,21 @@ module.exports = { * * https://eslint.org/docs/rules/ */ - 'array-bracket-newline': [ERROR, 'consistent'], - 'array-bracket-spacing': [ERROR], - 'array-element-newline': [ERROR, 'consistent'], - 'arrow-parens': [OFF, 'as-needed'], - 'arrow-spacing': ERROR, + 'arrow-parens': OFF, 'comma-dangle': OFF, // Is handled by TS plugin curly: ERROR, 'default-param-last': OFF, // Is handled by TS plugin 'dot-notation': OFF, // Is handled by TS plugin - 'eol-last': ERROR, - 'func-style': [ERROR, 'expression'], - 'function-call-argument-newline': [ERROR, 'consistent'], - 'function-paren-newline': ['error', 'multiline-arguments'], eqeqeq: [ERROR, 'always'], 'guard-for-in': ERROR, 'id-match': ERROR, - indent: [ERROR, 4, { SwitchCase: 1 }], - 'jsx-quotes': [ERROR, 'prefer-double'], - 'key-spacing': ERROR, 'max-classes-per-file': [ERROR, 10], - 'new-parens': ERROR, 'no-bitwise': ERROR, 'no-caller': ERROR, 'no-console': ERROR, 'no-eval': ERROR, 'no-extra-bind': ERROR, 'no-lone-blocks': ERROR, - 'no-multi-spaces': ERROR, - 'no-multiple-empty-lines': [ERROR, { max: 1 }], 'no-new-func': ERROR, 'no-new-wrappers': ERROR, 'no-prototype-builtins': OFF, // We take the risk, plus we only use it in a few occasions @@ -130,27 +116,13 @@ module.exports = { 'no-throw-literal': ERROR, 'no-unused-expressions': OFF, // Is handled by TS plugin 'no-useless-return': ERROR, - 'object-curly-newline': [ERROR, { consistent: true }], - 'object-curly-spacing': [ERROR, 'always'], - 'object-property-newline': [ERROR, { allowAllPropertiesOnSameLine: true }], 'object-shorthand': ERROR, 'one-var': [ERROR, 'never'], 'prefer-object-spread': ERROR, 'prefer-template': ERROR, - 'quote-props': [ERROR, 'consistent-as-needed'], radix: ERROR, 'space-before-blocks': OFF, // Is handled by TS plugin - 'space-before-function-paren': [ - ERROR, - { - anonymous: 'never', - asyncArrow: 'always', - named: 'never', - }, - ], 'spaced-comment': ERROR, - 'space-in-parens': [ERROR, 'never'], - 'template-curly-spacing': ERROR, /** * React plugin @@ -159,38 +131,10 @@ module.exports = { */ 'react/default-props-match-prop-types': [ERROR, { allowRequiredDefaults: true }], 'react/display-name': OFF, - 'react/jsx-closing-bracket-location': ERROR, - 'react/jsx-closing-tag-location': ERROR, 'react/jsx-curly-brace-presence': ERROR, - 'react/jsx-curly-spacing': ERROR, - 'react/jsx-first-prop-new-line': [ERROR, 'multiline'], - 'react/jsx-equals-spacing': ERROR, - 'react/jsx-indent': ERROR, 'react/jsx-no-bind': ERROR, 'react/jsx-no-target-blank': OFF, 'react/jsx-no-useless-fragment': [ERROR, { allowExpressions: true }], - 'react/jsx-props-no-multi-spaces': ERROR, - 'react/jsx-tag-spacing': [ - ERROR, - { - closingSlash: 'never', - beforeSelfClosing: 'always', - afterOpening: 'never', - beforeClosing: 'never', - }, - ], - 'react/jsx-wrap-multilines': [ - ERROR, - { - declaration: 'parens-new-line', - assignment: 'parens-new-line', - return: 'parens-new-line', - arrow: 'parens-new-line', - condition: 'parens-new-line', - logical: 'parens-new-line', - prop: 'parens-new-line', - }, - ], 'react/no-access-state-in-setstate': ERROR, 'react/no-adjacent-inline-elements': OFF, 'react/no-array-index-key': ERROR, @@ -219,22 +163,7 @@ module.exports = { */ '@typescript-eslint/array-type': [ERROR, { default: 'generic' }], '@typescript-eslint/ban-ts-comment': ERROR, - '@typescript-eslint/brace-style': ERROR, '@typescript-eslint/camelcase': OFF, // Too many external influences for a consistent case style - '@typescript-eslint/comma-dangle': [ - ERROR, - { - arrays: 'always-multiline', - objects: 'always-multiline', - imports: 'always-multiline', - exports: 'always-multiline', - functions: 'only-multiline', - enums: 'always-multiline', - generics: 'always-multiline', - tuples: 'always-multiline', - }, - ], - '@typescript-eslint/comma-spacing': ERROR, '@typescript-eslint/consistent-indexed-object-style': [ERROR, 'record'], '@typescript-eslint/consistent-type-assertions': [ ERROR, @@ -262,22 +191,7 @@ module.exports = { }, ], '@typescript-eslint/explicit-module-boundary-types': ERROR, - '@typescript-eslint/func-call-spacing': ERROR, '@typescript-eslint/init-declarations': ERROR, - '@typescript-eslint/keyword-spacing': ERROR, - '@typescript-eslint/member-delimiter-style': [ - ERROR, - { - multiline: { - delimiter: 'semi', - requireLast: true, - }, - singleline: { - delimiter: 'semi', - requireLast: false, - }, - }, - ], '@typescript-eslint/member-ordering': [ ERROR, { @@ -330,7 +244,6 @@ module.exports = { '@typescript-eslint/no-confusing-void-expression': [ERROR, { ignoreArrowShorthand: true }], '@typescript-eslint/no-dupe-class-members': ERROR, '@typescript-eslint/no-explicit-any': ERROR, - '@typescript-eslint/no-extra-parens': [ERROR, 'functions'], '@typescript-eslint/no-floating-promises': OFF, // We only handle promises if necessary '@typescript-eslint/no-inferrable-types': OFF, // We want to set those types explicitly '@typescript-eslint/no-invalid-this': ERROR, @@ -352,7 +265,7 @@ module.exports = { '@typescript-eslint/no-unsafe-return': ERROR, '@typescript-eslint/no-unused-expressions': ERROR, '@typescript-eslint/no-unused-vars': OFF, // unused-imports plugin takes care of this - '@typescript-eslint/no-use-before-define': WARNING, + '@typescript-eslint/no-use-before-define': ERROR, '@typescript-eslint/no-useless-constructor': ERROR, '@typescript-eslint/no-var-requires': OFF, // We only use require() if we need to '@typescript-eslint/non-nullable-type-assertion-style': ERROR, @@ -366,26 +279,9 @@ module.exports = { '@typescript-eslint/prefer-regexp-exec': ERROR, '@typescript-eslint/prefer-string-starts-ends-with': ERROR, '@typescript-eslint/prefer-ts-expect-error': ERROR, - '@typescript-eslint/quotes': [ - ERROR, - 'single', - { avoidEscape: true, allowTemplateLiterals: false }, - ], '@typescript-eslint/require-await': ERROR, '@typescript-eslint/restrict-template-expressions': [ERROR, { allowNumber: true }], - '@typescript-eslint/semi': [ERROR, 'always'], - '@typescript-eslint/space-before-blocks': ERROR, - '@typescript-eslint/space-before-function-paren': [ - ERROR, - { - anonymous: 'never', - asyncArrow: 'always', - named: 'never', - }, - ], - '@typescript-eslint/space-infix-ops': ERROR, '@typescript-eslint/strict-boolean-expressions': ERROR, - '@typescript-eslint/type-annotation-spacing': ERROR, '@typescript-eslint/unbound-method': OFF, // Doesn't recognize autobind decorator '@typescript-eslint/unified-signatures': ERROR, @@ -452,7 +348,6 @@ module.exports = { * * https://github.com/sindresorhus/eslint-plugin-unicorn/#rules */ - 'unicorn/empty-brace-spaces': ERROR, 'unicorn/explicit-length-check': ERROR, 'unicorn/no-array-push-push': ERROR, 'unicorn/prefer-array-find': ERROR, diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 574d83d..0f84f92 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,24 +1,18 @@ name: Docker Image CI on: - push: - workflow_dispatch: - + push: + workflow_dispatch: jobs: - lint: - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v2 - - - name: Install dependencies - run: npm ci - - - name: Lint - run: npm run lint - - + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install dependencies + run: npm ci + - name: Lint + run: npm run lint # build: # runs-on: ubuntu-latest # needs: lint diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..3ad954a --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +package-lock.json +package.json diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..f7a558b --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,22 @@ +{ + "arrowParens": "always", + "bracketSameLine": false, + "bracketSpacing": true, + "semi": true, + "singleQuote": true, + "jsxSingleQuote": false, + "quoteProps": "as-needed", + "trailingComma": "all", + "singleAttributePerLine": false, + "htmlWhitespaceSensitivity": "css", + "vueIndentScriptAndStyle": false, + "proseWrap": "preserve", + "insertPragma": false, + "printWidth": 100, + "requirePragma": false, + "tabWidth": 4, + "useTabs": false, + "embeddedLanguageFormatting": "auto", + "plugins": ["prettier-plugin-tailwindcss"], + "experimentalTernaries": false +} diff --git a/components.json b/components.json index c2b51be..73e8500 100644 --- a/components.json +++ b/components.json @@ -1,17 +1,17 @@ { - "$schema": "https://ui.shadcn.com/schema.json", - "style": "new-york", - "rsc": true, - "tsx": true, - "tailwind": { - "config": "tailwind.config.js", - "css": "styles/globals.css", - "baseColor": "zinc", - "cssVariables": true, - "prefix": "" - }, - "aliases": { - "components": "components", - "utils": "@/lib/utils" - } -} \ No newline at end of file + "$schema": "https://ui.shadcn.com/schema.json", + "style": "new-york", + "rsc": true, + "tsx": true, + "tailwind": { + "config": "tailwind.config.js", + "css": "styles/globals.css", + "baseColor": "zinc", + "cssVariables": true, + "prefix": "" + }, + "aliases": { + "components": "components", + "utils": "@/lib/utils" + } +} diff --git a/package.json b/package.json index 6876566..c6a3f9f 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,9 @@ "lint": "next lint -c .eslintrc.js", "lint:fix": "next lint -c .eslintrc.js -- --fix", "tsc": "tsc --noEmit", - "tsc:watch": "tsc --noEmit --watch" + "tsc:watch": "tsc --noEmit --watch", + "prettier": "prettier . --check", + "prettier:fix": "prettier . --write" }, "dependencies": { "@fortawesome/fontawesome-svg-core": "6.5.x", diff --git a/prettier.config.js b/prettier.config.js deleted file mode 100644 index afbf9dc..0000000 --- a/prettier.config.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - printWidth: 100, - trailingComma: 'all', - semi: true, - tabWidth: 4, - singleQuote: true, - jsxSingleQuote: false, - plugins: ['prettier-plugin-tailwindcss'], - experimentalTernaries: false, -}; diff --git a/public/manifest.json b/public/manifest.json index 1f94834..0883abd 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -1,21 +1,21 @@ { - "name": "B-Side", - "short_name": "B-Side", - "theme_color": "#ffffff", - "background_color": "#000000", - "start_url": "/?pwa", - "display": "standalone", - "orientation": "portrait", - "icons": [ - { - "src": "/favicon-192.png", - "type": "image/png", - "sizes": "192x192" - }, - { - "src": "/favicon-512.png", - "type": "image/png", - "sizes": "256x256" - } - ] + "name": "B-Side", + "short_name": "B-Side", + "theme_color": "#ffffff", + "background_color": "#000000", + "start_url": "/?pwa", + "display": "standalone", + "orientation": "portrait", + "icons": [ + { + "src": "/favicon-192.png", + "type": "image/png", + "sizes": "192x192" + }, + { + "src": "/favicon-512.png", + "type": "image/png", + "sizes": "256x256" + } + ] } diff --git a/styles/globals.css b/styles/globals.css index ec95278..f187670 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -3,14 +3,14 @@ @tailwind utilities; @font-face { - font-family: "American Typewriter"; - src: url("../public/fonts/American Typewriter Bold.ttf"); + font-family: 'American Typewriter'; + src: url('../public/fonts/American Typewriter Bold.ttf'); font-display: swap; } @font-face { - font-family: "Mulish"; - src: url("../public/fonts/Mulish-Regular.ttf"); + font-family: 'Mulish'; + src: url('../public/fonts/Mulish-Regular.ttf'); font-display: swap; } @tailwind base; @@ -88,4 +88,4 @@ body { @apply bg-background text-foreground; } -} \ No newline at end of file +} diff --git a/tsconfig.json b/tsconfig.json index c8a4174..48d5cea 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,31 +1,31 @@ { - "compilerOptions": { - "baseUrl": ".", - "target": "es5", - "lib": ["dom", "dom.iterable", "esnext"], - "allowJs": true, - "skipLibCheck": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "noEmit": true, - "esModuleInterop": true, - "module": "esnext", - "noUncheckedIndexedAccess": true, - "moduleResolution": "node", - "resolveJsonModule": true, - "isolatedModules": true, - "jsx": "preserve", - "incremental": true, - "paths": { - "@/components/*": ["components/*"], - "@/lib/*": ["lib/*"], - "@/pages/*": ["pages/*"], - "@/public/*": ["public/*"], - "@/styles/*": ["styles/*"], - "@/types/*": ["types/*"], - "@blocks/*": ["components/blocks/*"], - } - }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], - "exclude": ["node_modules"] + "compilerOptions": { + "baseUrl": ".", + "target": "es5", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true, + "esModuleInterop": true, + "module": "esnext", + "noUncheckedIndexedAccess": true, + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve", + "incremental": true, + "paths": { + "@/components/*": ["components/*"], + "@/lib/*": ["lib/*"], + "@/pages/*": ["pages/*"], + "@/public/*": ["public/*"], + "@/styles/*": ["styles/*"], + "@/types/*": ["types/*"], + "@blocks/*": ["components/blocks/*"] + } + }, + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + "exclude": ["node_modules"] }