Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Type of PR 🍩
Copy link
Collaborator

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😍


- [ ] 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)
1 change: 1 addition & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run test && npm run lint && npm run type-check
2 changes: 2 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
"eslint.useFlatConfig": false,
"eslint.useFlatConfig": true,
// Ensure enough terminal history is preserved when running tests.
"terminal.integrated.scrollback": 10000,
"cSpell.words": ["heroui"]
Expand Down
237 changes: 223 additions & 14 deletions eslint.config.mjs
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',
},
}
);
1 change: 1 addition & 0 deletions hero.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import { heroui } from '@heroui/react';

export default heroui();
Loading