Skip to content

Commit

Permalink
Merge pull request #3706 from udecode/feat/templates
Browse files Browse the repository at this point in the history
Feat/templates
  • Loading branch information
zbeyens committed Nov 1, 2024
1 parent d39c118 commit 6e9697a
Show file tree
Hide file tree
Showing 129 changed files with 3,518 additions and 3,065 deletions.
274 changes: 254 additions & 20 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,52 +1,286 @@
const path = require('path');

const prettierConfig = require('./prettier.config.js');

module.exports = {
$schema: 'https://json.schemastore.org/eslintrc',
root: true,
extends: [
'next/core-web-vitals',
'prettier',
'plugin:tailwindcss/recommended',
'plugin:perfectionist/recommended-natural-legacy',
],
plugins: ['tailwindcss', 'unused-imports', 'prettier'],
overrides: [
{
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser',
},
],
plugins: ['tailwindcss', 'unused-imports', 'perfectionist', 'prettier'],

root: true,
rules: {
'@next/next/no-html-link-for-pages': 'off',
'prettier/prettier': ['warn', { ...prettierConfig }],
'react/jsx-key': 'off',
'react/display-name': 'off',
'react/jsx-key': 'off',
'tailwindcss/classnames-order': 'warn',
'tailwindcss/no-custom-classname': [
'error',
{
whitelist: ['ignore-click-outside/toolbar'],
},
],
'tailwindcss/no-custom-classname': 'off',
'unused-imports/no-unused-imports': 'warn',
'unused-imports/no-unused-vars': [
'warn',
{
args: 'none',
argsIgnorePattern: '^_',
ignoreRestSiblings: true,
vars: 'all',
varsIgnorePattern: '^_',
args: 'none',
argsIgnorePattern: '^_',
},
],
// Perfectionist
...{
'@typescript-eslint/adjacent-overload-signatures': 'off',

'perfectionist/sort-array-includes': [
'warn',
{
groupKind: 'literals-first',
ignoreCase: false,
type: 'natural',
},
],

'perfectionist/sort-astro-attributes': [
'warn',
{ ignoreCase: false, type: 'natural' },
],
'perfectionist/sort-classes': [
'warn',
{
groups: [
'index-signature',
'static-property',
'private-property',
'protected-property',
'property',
'constructor',
'static-method',
'private-method',
'protected-method',
'method',
['get-method', 'set-method'],
'static-block',
'unknown',
],
ignoreCase: false,
type: 'natural',
},
],
'perfectionist/sort-enums': [
'warn',
{
ignoreCase: false,
sortByValue: true,
type: 'natural',
},
],
'perfectionist/sort-exports': [
'warn',
{ ignoreCase: false, type: 'natural' },
],
'perfectionist/sort-imports': [
// 'off',
'warn',
{
customGroups: {
type: {
next: 'next',
react: 'react',
},
value: {
next: ['next'],
react: ['react', 'react-*'],
},
},
groups: [
'react',
['type', 'internal-type'],
'next',
['builtin', 'external'],
'internal',
['parent-type', 'sibling-type', 'index-type'],
['parent', 'sibling', 'index'],
'side-effect',
'style',
'object',
'unknown',
],
ignoreCase: false,
internalPattern: ['@/**'],
type: 'natural',
},
],
'perfectionist/sort-interfaces': [
'warn',
{
customGroups: {
key: ['key', 'keys'],
id: ['id', '_id'],
},
groupKind: 'required-first',
groups: ['key', 'id', 'multiline', 'unknown'],
ignoreCase: false,
type: 'natural',
},
],
// breaking: ordering matters
'perfectionist/sort-intersection-types': 'off',
'perfectionist/sort-jsx-props': [
'warn',
{
customGroups: {
key: ['key', 'keys'],
id: ['id', 'name', 'testId', 'data-testid'],
accessibility: [
'title',
'alt',
'placeholder',
'label',
'description',
'fallback',
],
callback: ['on*', 'handle*'],
className: ['className', 'class', 'style'],
control: ['asChild', 'as'],
data: ['data-*', 'aria-*'],
ref: ['ref', 'innerRef'],
state: [
'value',
'checked',
'selected',
'open',
'defaultValue',
'defaultChecked',
'defaultOpen',
'disabled',
'required',
'readOnly',
'loading',
],
variant: ['variant', 'size', 'orientation', 'color'],
},
groups: [
'id',
'key',
'ref',
'control',
'variant',
'className',
'state',
'callback',
'accessibility',
'data',
'unknown',
'shorthand',
],
ignoreCase: false,
type: 'natural',
},
],
'perfectionist/sort-maps': [
'warn',
{ ignoreCase: false, type: 'natural' },
],
'perfectionist/sort-named-exports': [
'warn',
{ groupKind: 'types-first', ignoreCase: false, type: 'natural' },
],
// 'perfectionist/sort-named-imports': ['off'],
'perfectionist/sort-named-imports': [
'warn',
{ groupKind: 'types-first', ignoreCase: false, type: 'natural' },
],
'perfectionist/sort-object-types': [
'warn',
{
customGroups: {
key: ['key', 'keys'],
id: ['id', '_id'],
callback: ['on*', 'handle*'],
},
groupKind: 'required-first',
groups: ['key', 'id', 'multiline', 'unknown', 'callback'],
ignoreCase: false,
type: 'natural',
},
],
'perfectionist/sort-objects': [
'warn',
{
customGroups: {
key: ['key', 'keys'],
id: ['id', '_id'],
callback: ['on*', 'handle*'],
},
groups: ['key', 'id', 'unknown', 'callback'],
ignoreCase: false,
type: 'natural',
},
],
'perfectionist/sort-sets': [
'warn',
{
ignoreCase: false,
type: 'natural',
},
],
'perfectionist/sort-switch-case': [
'warn',
{
ignoreCase: false,
type: 'natural',
},
],
'perfectionist/sort-union-types': [
'warn',
{
groups: [
'conditional',
'function',
'import',
['intersection', 'union'],
'named',
'operator',
'object',
'keyword',
'literal',
'tuple',
'nullish',
'unknown',
],
ignoreCase: false,
type: 'natural',
},
],
'perfectionist/sort-variable-declarations': [
'warn',
{
ignoreCase: false,
type: 'natural',
},
],
'react/jsx-sort-props': 'off',
'sort-imports': 'off',
'sort-keys': 'off',
},
},
settings: {
next: {
rootDir: ['./'],
},
tailwindcss: {
callees: ['cn', 'cva', 'withCn'],
config: path.join(__dirname, './tailwind.config.js'),
},
next: {
rootDir: ['./'],
},
},
overrides: [
{
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser',
},
],
};
25 changes: 15 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"lint": "next lint",
"lint:fix": "next lint --fix",
"preview": "next build && next start",
"sync": "tsx --tsconfig ./scripts/tsconfig.scripts.json scripts/sync.mts",
"typecheck": "tsc --noEmit"
},
"dependencies": {
Expand All @@ -19,7 +20,7 @@
"@radix-ui/react-context-menu": "^2.2.1",
"@radix-ui/react-dialog": "^1.1.2",
"@radix-ui/react-dropdown-menu": "2.1.2",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-icons": "^1.3.1",
"@radix-ui/react-popover": "^1.1.2",
"@radix-ui/react-scroll-area": "^1.2.0",
"@radix-ui/react-separator": "^1.1.0",
Expand All @@ -34,11 +35,12 @@
"@udecode/plate-basic-marks": "^39.0.0",
"@udecode/plate-block-quote": "^39.0.0",
"@udecode/plate-break": "^39.0.0",
"@udecode/plate-callout": "^39.2.18",
"@udecode/plate-caption": "^39.0.0",
"@udecode/plate-code-block": "^39.0.0",
"@udecode/plate-combobox": "39.0.0",
"@udecode/plate-comments": "^39.0.0",
"@udecode/plate-common": "39.2.15",
"@udecode/plate-common": "39.2.20",
"@udecode/plate-csv": "^39.1.6",
"@udecode/plate-cursor": "^39.2.11",
"@udecode/plate-date": "^39.0.0",
Expand All @@ -62,6 +64,7 @@
"@udecode/plate-link": "^39.1.9",
"@udecode/plate-list": "^39.0.0",
"@udecode/plate-markdown": "39.2.0",
"@udecode/plate-math": "^39.2.0",
"@udecode/plate-media": "39.2.13",
"@udecode/plate-mention": "^39.0.0",
"@udecode/plate-node-id": "^39.0.0",
Expand All @@ -75,13 +78,13 @@
"@udecode/plate-table": "^39.1.6",
"@udecode/plate-toggle": "^39.0.0",
"@udecode/plate-trailing-block": "^39.0.0",
"ai": "^3.4.10",
"ai": "^3.4.30",
"class-variance-authority": "0.7.0",
"cmdk": "1.0.0",
"cmdk": "1.0.3",
"date-fns": "^4.1.0",
"eslint-plugin-prettier": "^5.2.1",
"lucide-react": "0.453.0",
"next": "^15.0.1",
"lucide-react": "0.454.0",
"next": "^15.0.2",
"next-themes": "^0.3.0",
"prismjs": "^1.29.0",
"react": "^18.3.1",
Expand All @@ -90,6 +93,7 @@
"react-dnd-html5-backend": "^16.0.1",
"react-dom": "^18.3.1",
"react-lite-youtube-embed": "^2.4.0",
"react-resizable-panels": "^2.1.6",
"react-tweet": "^3.2.1",
"slate": "0.110.2",
"slate-history": "0.110.3",
Expand All @@ -100,21 +104,22 @@
"tailwindcss-animate": "1.0.7"
},
"devDependencies": {
"@ianvs/prettier-plugin-sort-imports": "^4.3.1",
"@types/node": "^22.7.9",
"@types/node": "^22.8.6",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@typescript-eslint/parser": "^8.11.0",
"@typescript-eslint/parser": "^8.12.2",
"autoprefixer": "^10.4.20",
"encoding": "^0.1.13",
"eslint": "^8.56.0",
"eslint-config-next": "15.0.1",
"eslint-config-next": "15.0.2",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-perfectionist": "^3.9.1",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-tailwindcss": "^3.17.5",
"eslint-plugin-unused-imports": "^4.1.3",
"postcss": "^8.4.45",
"prettier": "^3.3.3",
"prettier-plugin-packagejson": "^2.5.3",
"tailwindcss": "^3.4.14",
"tsx": "^4.19.1",
"typescript": "5.6.3"
Expand Down
Loading

0 comments on commit 6e9697a

Please sign in to comment.