Skip to content

Commit

Permalink
Merge pull request #3 from kagankan/feature/move-files
Browse files Browse the repository at this point in the history
Move files from `markuplint` repo
  • Loading branch information
kagankan authored Aug 28, 2024
2 parents a639133 + 69178c6 commit f5536c0
Show file tree
Hide file tree
Showing 101 changed files with 14,089 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
extends: ['@commitlint/config-conventional'],
};
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# https://editorconfig.org
root = true

[*]
indent_style = tab
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
81 changes: 81 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"root": true,
"extends": [
"@markuplint-dev/eslint-config",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:testing-library/react"
],
"plugins": ["react", "react-hooks", "react-refresh", "testing-library", "vitest"],
"env": {
"browser": true
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
}
},
"settings": {
"react": {
"version": "detect"
},
"import/resolver": {
"typescript": []
}
},
"rules": {
"@typescript-eslint/no-unused-vars": [2, { "argsIgnorePattern": "^_", "ignoreRestSiblings": true }],
"@typescript-eslint/prefer-readonly-parameter-types": [
1,
{
"allow": [
{ "from": "lib", "name": "URL" },
{ "from": "package", "package": "json-schema", "name": "JSONSchema7" },
{ "from": "package", "package": "json-schema", "name": "JSONSchema7Definition" }
],
"checkParameterProperties": false,
"ignoreInferredTypes": true
}
],
"react/display-name": 0,
"react/prop-types": 0,
"react-refresh/only-export-components": "warn"
},
"globals": {
"React": true,
"JSX": true
},
"overrides": [
{
"files": ["./*.js"],
"rules": {
"@typescript-eslint/no-var-requires": 0
}
},
{
"files": ["./*.mjs"],
"rules": {
"import/no-named-as-default-member": 0
}
},
{
"files": ["./**/*.tsx"],
"rules": {
"unicorn/filename-case": 0
}
},
{
"files": ["./**/*.spec.ts", "./**/*.spec.tsx"],
"rules": {
"testing-library/prefer-user-event": 2,
"testing-library/no-manual-cleanup": 0
}
},
{
"files": ["./vitest.config.ts"],
"rules": {
"import/no-default-export": 0
}
}
]
}
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @kagankan
51 changes: 51 additions & 0 deletions .github/workflows/playground.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Playground Test

on:
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ./node_modules
key: depends-${{ hashFiles('yarn.lock') }}

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Building Test
run: yarn build

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Cache dependencies
uses: actions/cache@v4
with:
path: ./node_modules
key: depends-${{ hashFiles('yarn.lock') }}

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Lint
run: yarn lint
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# Playwright
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
2 changes: 2 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
yarn commitlint --edit "$1"
14 changes: 14 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

# Get the current branch name
branch_name=$(git symbolic-ref --short HEAD)

# Prevent direct commits to the main or dev branch
if [ "$branch_name" = "main" ]; then
echo "Direct commits to the $branch_name branch are prohibited."
echo "Please commit to an appropriate branch and merge it instead."
exit 1
fi

yarn lint-staged
6 changes: 6 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"**/*.{ts,tsx,js,cjs,mjs,json}": ["prettier --write"],
"**/*.{ts,mjs,cjs,spec.js}": ["eslint --fix"],
".github/workflows/*.yml": ["actionlint"],
"**": ["cspell --no-must-find-files --no-progress --show-suggestions"]
}
21 changes: 21 additions & 0 deletions .markuplintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"excludeFiles": ["./src/examples/**/*"],
"extends": ["markuplint:recommended-react"],
"parser": {
"\\.tsx$": "@markuplint/jsx-parser"
},
"specs": {
"\\.tsx$": "@markuplint/react-spec"
},
"rules": {
"heading-levels": false
},
"nodeRules": [
{
"selector": "option",
"rules": {
"permitted-contents": false
}
}
]
}
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/examples/files/**/code*
15 changes: 15 additions & 0 deletions .prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import config from '@markuplint-dev/prettier-config';

export default {
...config,
plugins: ['prettier-plugin-tailwindcss'],
overrides: [
{
files: ['./src/examples/files/**'],
options: {
tabWidth: 2,
useTabs: false,
},
},
],
};
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017-2024 Yusuke Hirao

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Binary file modified README.md
Binary file not shown.
Loading

0 comments on commit f5536c0

Please sign in to comment.