Skip to content

Commit

Permalink
Merge pull request #2 from jotaijs/modernize
Browse files Browse the repository at this point in the history
modernize repo
  • Loading branch information
dmaskasky authored Jan 23, 2025
2 parents 4fb67e1 + 3a087c1 commit 8ad15b9
Show file tree
Hide file tree
Showing 23 changed files with 2,746 additions and 7,762 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

126 changes: 0 additions & 126 deletions .eslintrc.json

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8.2.0
version: 8.15.0
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8.2.0
version: 8.15.0
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- run: pnpm install --frozen-lockfile
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
*~
*.swp
.vscode
dist
jotai
node_modules
/dist
5 changes: 3 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.md
pnpm-lock.yaml
/pnpm-lock.yaml
/dist
README.md
122 changes: 122 additions & 0 deletions eslint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
import js from '@eslint/js'
import configPrettier from 'eslint-config-prettier'
import importPlugin from 'eslint-plugin-import'
import prettierPlugin from 'eslint-plugin-prettier'
import * as tseslint from 'typescript-eslint'

export default tseslint.config(
// ─────────────────────────────────────────────────────────────
// 1) Main config, merges "extends" equivalents + custom rules
// ─────────────────────────────────────────────────────────────
{
files: ['**/*.{js,jsx,ts,tsx,json}'],
},
{
plugins: {
prettier: prettierPlugin,
'@typescript-eslint': tseslint.plugin,
},
},
js.configs.recommended,
tseslint.configs.recommended,
configPrettier,
importPlugin.flatConfigs.recommended,
{
rules: {
curly: ['warn', 'multi-line', 'consistent'],
eqeqeq: 'error',
'no-console': 'off',
'no-inner-declarations': 'off',
'no-var': 'error',
'prefer-const': 'error',
'sort-imports': [
'error',
{
ignoreDeclarationSort: true,
},
],
'import/export': 'error',
'import/no-duplicates': ['error'],
'import/no-unresolved': ['error', { commonjs: true, amd: true }],
'import/order': [
'error',
{
alphabetize: { order: 'asc', caseInsensitive: true },
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
'object',
],
'newlines-between': 'never',
pathGroups: [
{
pattern: 'react',
group: 'builtin',
position: 'before',
},
],
pathGroupsExcludedImportTypes: ['builtin'],
},
],
'prettier/prettier': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
'@typescript-eslint/no-use-before-define': 'off',
},
settings: {
react: { version: 'detect' },
'import/extensions': ['.js', '.jsx', '.ts', '.tsx'],
'import/parsers': {
'@typescript-eslint/parser': ['.js', '.jsx', '.ts', '.tsx'],
},
'import/resolver': {
typescript: true,
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
paths: ['src'],
},
},
},
},
{
ignores: ['dist/'],
},

// ─────────────────────────────────────────────────────────────
// 2) Overrides for "src" — specify TS project config
// ─────────────────────────────────────────────────────────────
{
files: ['src'],
languageOptions: {
parserOptions: {
project: './tsconfig.json',
},
},
},

// ─────────────────────────────────────────────────────────────
// 3) Overrides for test files (if needed)
// ─────────────────────────────────────────────────────────────
{
files: ['tests/**/*.tsx', 'tests/**/*'],
rules: {},
},

// ─────────────────────────────────────────────────────────────
// 4) Overrides for JS config files in root
// ─────────────────────────────────────────────────────────────
{
files: ['./*.js'],
rules: {},
}
)
27 changes: 0 additions & 27 deletions examples/01_typescript/package.json

This file was deleted.

8 changes: 0 additions & 8 deletions examples/01_typescript/public/index.html

This file was deleted.

39 changes: 0 additions & 39 deletions examples/01_typescript/src/App.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions examples/01_typescript/src/index.tsx

This file was deleted.

Loading

0 comments on commit 8ad15b9

Please sign in to comment.