-
Notifications
You must be signed in to change notification settings - Fork 0
Chore/pr template and linting improvement #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
dc1a9f4
chore: add pull request template
anastanei 83d297d
chore: add stylelint
anastanei 2dc8169
chore: add type-check script
anastanei 9132a61
Merge branch 'develop' into chore/pr-template-and-linting-improvement
anastanei fd7e324
chore: add eslint rules for test files
anastanei c977b59
chore: add husky on pre-push
anastanei f4119a7
chore: add @rollup/rollup-linux-x64-gnu dependendies
anastanei 4e27e7f
chore: remove redundant self-check line
anastanei File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # Type of PR 🍩 | ||
|
|
||
| - [ ] Feature | ||
| - [ ] Bugfix | ||
| - [ ] Hotfix | ||
| - [ ] Refactoring | ||
| - [ ] Documentation | ||
| - [ ] Infrastructure | ||
|
|
||
| ## Changes Introduced 🥯 | ||
|
|
||
| - Implemented: [feature name] (mention addition functionality if relevant) | ||
| - Refactored: [Component/Module] (explain reasoning if significant) | ||
| - Fixed: [Bug description] (include error references if applicable) | ||
| - Updated: [Documentation/Configuration] (specify locations) | ||
|
|
||
| ### Self-Check ✅ | ||
|
|
||
| - [ ] No console errors (except API requests) | ||
| - [ ] 80%+ test coverage | ||
| - [ ] Documentation updated (if relevant) | ||
| - [ ] Package.json scripts updated (if relevant) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| npm run test && npm run lint && npm run type-check |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| dist | ||
| node_modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,226 @@ | ||
| import { FlatCompat } from '@eslint/eslintrc'; | ||
| import js from '@eslint/js'; | ||
| import globals from 'globals'; | ||
| import reactRefresh from 'eslint-plugin-react-refresh'; | ||
| import tseslint, { configs as tsConfigs } from 'typescript-eslint'; | ||
| import stylistic from '@stylistic/eslint-plugin'; | ||
| import prettierConfig from 'eslint-config-prettier'; | ||
| import importPlugin from 'eslint-plugin-import-x'; | ||
| import perfectionistPlugin from 'eslint-plugin-perfectionist'; | ||
| import unicornPlugin from 'eslint-plugin-unicorn'; | ||
| import react from 'eslint-plugin-react'; | ||
| import reactDom from 'eslint-plugin-react-dom'; | ||
| import reactHooks from 'eslint-plugin-react-hooks'; | ||
| import * as reactCompiler from 'eslint-plugin-react-compiler'; | ||
| import jsxA11y from 'eslint-plugin-jsx-a11y'; | ||
| import next from '@next/eslint-plugin-next'; | ||
| import testingLibrary from 'eslint-plugin-testing-library'; | ||
| import jestDom from 'eslint-plugin-jest-dom'; | ||
| import vitest from '@vitest/eslint-plugin'; | ||
|
|
||
| const compat = new FlatCompat({ | ||
| // import.meta.dirname is available after Node.js v20.11.0 | ||
| baseDirectory: import.meta.dirname, | ||
| }); | ||
|
|
||
| const eslintConfig = [ | ||
| ...compat.config({ | ||
| extends: ['next', 'prettier'], | ||
| }), | ||
| export default tseslint.config( | ||
| tsConfigs.stylisticTypeChecked, | ||
| tsConfigs.strictTypeChecked, | ||
| unicornPlugin.configs.recommended, | ||
| { | ||
| ignores: ['node_modules/**', '.next/**', 'out/**', 'build/**', 'next-env.d.ts'], | ||
| ignores: [ | ||
| '**/*.js', | ||
| '**/*.config.js', | ||
| '**/*.config.ts', | ||
| '**/*.mjs', | ||
| '**/*.config.mjs', | ||
| 'dist', | ||
| '.next', | ||
| 'next-env.d.ts', | ||
| ], | ||
| }, | ||
| ]; | ||
|
|
||
| export default eslintConfig; | ||
| { | ||
| extends: [js.configs.recommended, ...tseslint.configs.recommended], | ||
| files: ['**/*.{ts,tsx}'], | ||
| languageOptions: { | ||
| ecmaVersion: 2025, | ||
| globals: globals.browser, | ||
| sourceType: 'module', | ||
| parserOptions: { | ||
| projectService: true, | ||
| tsconfigRootDir: import.meta.dirname, | ||
| }, | ||
| }, | ||
| settings: { | ||
| 'import-x/parsers': { | ||
| '@typescript-eslint/parser': ['.ts', '.tsx'], | ||
| }, | ||
| 'import-x/resolver': { | ||
| typescript: { | ||
| alwaysTryTypes: true, | ||
| project: './tsconfig.json', | ||
| }, | ||
| }, | ||
| react: { | ||
| version: 'detect', | ||
| }, | ||
| }, | ||
| plugins: { | ||
| react, | ||
| 'react-hooks': reactHooks, | ||
| 'react-dom': reactDom, | ||
| 'react-refresh': reactRefresh, | ||
| 'import-x': importPlugin, | ||
| perfectionist: perfectionistPlugin, | ||
| '@stylistic': stylistic, | ||
| 'jsx-a11y': jsxA11y, | ||
| 'react-compiler': reactCompiler, | ||
| '@next/next': next, | ||
| }, | ||
| linterOptions: { | ||
| noInlineConfig: true, | ||
| reportUnusedDisableDirectives: 'error', | ||
| }, | ||
| rules: { | ||
| ...react.configs.recommended.rules, | ||
| ...reactDom.configs.recommended.rules, | ||
| ...reactHooks.configs.recommended.rules, | ||
| ...next.configs.recommended.rules, | ||
| 'react-compiler/react-compiler': 'error', | ||
| 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }], | ||
| ...jsxA11y.configs.recommended.rules, | ||
| 'no-console': ['error', { allow: ['error'] }], | ||
| 'no-empty': 'warn', | ||
| curly: ['error', 'all'], | ||
| 'no-warning-comments': ['error', { terms: [''], location: 'anywhere' }], | ||
| 'quote-props': ['error', 'always'], | ||
| 'prefer-const': 'error', | ||
| 'prefer-arrow-callback': 'error', | ||
| 'no-confusing-arrow': ['error', { allowParens: true }], | ||
| curly: 'error', | ||
| '@typescript-eslint/prefer-readonly': 'error', | ||
| '@typescript-eslint/no-explicit-any': 'error', | ||
| '@typescript-eslint/no-magic-numbers': [ | ||
| 'error', | ||
| { | ||
| enforceConst: true, | ||
| ignoreEnums: true, | ||
| ignore: [0, 1, -1], | ||
| ignoreArrayIndexes: true, | ||
| ignoreDefaultValues: true, | ||
| ignoreClassFieldInitialValues: true, | ||
| }, | ||
| ], | ||
| '@typescript-eslint/consistent-type-imports': 'error', | ||
| '@typescript-eslint/consistent-type-definitions': ['error', 'type'], | ||
| '@typescript-eslint/consistent-type-assertions': ['error', { assertionStyle: 'never' }], | ||
| '@typescript-eslint/explicit-member-accessibility': [ | ||
| 'error', | ||
| { accessibility: 'explicit', overrides: { constructors: 'off' } }, | ||
| ], | ||
| '@typescript-eslint/member-ordering': 'error', | ||
| '@typescript-eslint/no-unused-vars': [ | ||
| 'error', | ||
| { | ||
| varsIgnorePattern: '^_', | ||
| argsIgnorePattern: '^_', | ||
| }, | ||
| ], | ||
| '@typescript-eslint/naming-convention': [ | ||
| 'error', | ||
| { | ||
| selector: 'typeLike', | ||
| format: ['PascalCase'], | ||
| }, | ||
| ], | ||
| ...prettierConfig.rules, | ||
| 'import-x/extensions': [ | ||
| 'error', | ||
| { | ||
| ts: 'never', | ||
| tsx: 'never', | ||
| svg: 'always', | ||
| css: 'always', | ||
| webp: 'always', | ||
| gif: 'always', | ||
| }, | ||
| ], | ||
| 'import-x/no-extraneous-dependencies': 'off', | ||
| 'import-x/no-cycle': ['error', { maxDepth: Infinity }], | ||
| 'import-x/first': 'error', | ||
| 'perfectionist/sort-imports': 'error', | ||
| '@stylistic/padding-line-between-statements': [ | ||
| 'error', | ||
| { blankLine: 'always', prev: '*', next: 'return' }, | ||
| { blankLine: 'always', prev: ['const', 'let', 'var'], next: '*' }, | ||
| { | ||
| blankLine: 'any', | ||
| prev: ['const', 'let', 'var'], | ||
| next: ['const', 'let', 'var'], | ||
| }, | ||
| { blankLine: 'always', prev: ['case', 'default'], next: '*' }, | ||
| { blankLine: 'always', prev: 'import', next: '*' }, | ||
| { blankLine: 'always', prev: '*', next: 'export' }, | ||
| { blankLine: 'any', prev: 'import', next: 'import' }, | ||
| ], | ||
| 'unicorn/no-array-callback-reference': 'off', | ||
| 'unicorn/prefer-at': 'off', | ||
| 'unicorn/no-array-for-each': 'off', | ||
| 'unicorn/no-array-reduce': 'off', | ||
| 'unicorn/no-null': 'off', | ||
| 'unicorn/number-literal-case': 'off', | ||
| 'unicorn/numeric-separators-style': 'off', | ||
| 'unicorn/prefer-global-this': 'off', | ||
| 'unicorn/prevent-abbreviations': [ | ||
| 'error', | ||
| { | ||
| allowList: { | ||
| acc: true, | ||
| env: true, | ||
| i: true, | ||
| j: true, | ||
| props: true, | ||
| Props: true, | ||
| args: true, | ||
| ImportMetaEnv: true, | ||
| ref: true, | ||
| Ref: true, | ||
| Params: true, | ||
| temp: true, | ||
| }, | ||
| }, | ||
| ], | ||
| 'unicorn/filename-case': [ | ||
| 'error', | ||
| { | ||
| cases: { | ||
| kebabCase: true, | ||
| }, | ||
| ignore: ['vite-env.d.ts'], | ||
| }, | ||
| ], | ||
| 'unicorn/prefer-string-raw': 'off', | ||
| 'react/jsx-uses-react': 'off', | ||
| 'react/react-in-jsx-scope': 'off', | ||
| 'react/prop-types': 'off', | ||
| 'jsx-a11y/click-events-have-key-events': 'off', | ||
| 'jsx-a11y/no-noninteractive-element-interactions': 'off', | ||
| }, | ||
| }, | ||
| { | ||
| files: ['src/app/layout.tsx'], | ||
| rules: { | ||
| 'react-refresh/only-export-components': 'off', | ||
| }, | ||
| }, | ||
| { | ||
| files: ['**/*.test.{js,ts,jsx,tsx}'], | ||
| plugins: { | ||
| 'testing-library': testingLibrary, | ||
| 'jest-dom': jestDom, | ||
| vitest: vitest, | ||
| }, | ||
| rules: { | ||
| ...testingLibrary.configs.react.rules, | ||
| ...jestDom.configs.recommended.rules, | ||
| ...vitest.configs.recommended.rules, | ||
| '@typescript-eslint/no-magic-numbers': 'off', | ||
| 'no-undef': 'off', | ||
| 'no-unused-expressions': 'off', | ||
| }, | ||
| } | ||
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| import { heroui } from '@heroui/react'; | ||
|
|
||
| export default heroui(); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely like our PR headings😍