Skip to content

Commit

Permalink
split example with the source code
Browse files Browse the repository at this point in the history
  • Loading branch information
rezkiy37 committed Aug 8, 2023
1 parent 3b42444 commit dcffbae
Show file tree
Hide file tree
Showing 15 changed files with 16,172 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
"es2021": true,
"jest": true
},
"extends": ["eslint:recommended", "airbnb", "plugin:@typescript-eslint/recommended", "plugin:react/jsx-runtime", "plugin:jsx-a11y/recommended", "plugin:react/recommended", "prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"ignorePatterns": ["dist", "node_modules", ".git", "webpack.config.js"],
"extends": ["eslint:recommended", "airbnb", "plugin:@typescript-eslint/recommended", "plugin:react/jsx-runtime", "plugin:jsx-a11y/recommended", "plugin:react/recommended", "prettier"],
"plugins": ["@typescript-eslint", "react", "jsx-a11y"],
"ignorePatterns": ["dist", "node_modules", ".git"],
"rules": {
"arrow-parens": [
"error",
Expand Down
74 changes: 74 additions & 0 deletions example/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
module.exports = {
root: true,
env: {
browser: true,
es2021: true,
jest: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
tsconfigRootDir: __dirname,
},
extends: ['eslint:recommended', 'airbnb', 'plugin:@typescript-eslint/recommended', 'plugin:react/jsx-runtime', 'plugin:jsx-a11y/recommended', 'plugin:react/recommended', 'prettier'],
plugins: ['@typescript-eslint', 'react', 'jsx-a11y'],
ignorePatterns: ['dist', 'node_modules', '.git'],
rules: {
'arrow-parens': [
'error',
'as-needed',
{
requireForBlockBody: true,
},
],
'no-invalid-this': 'error',
'react/function-component-definition': [
'error',
{
namedComponents: 'function-declaration',
unnamedComponents: 'arrow-function',
},
],
'no-restricted-syntax': [
'error',
// The following four selectors prevent the usage of async/await
{
selector: 'AwaitExpression',
message: 'async/await is not allowed',
},
{
selector: 'FunctionDeclaration[async=true]',
message: 'async functions are not allowed',
},
{
selector: 'FunctionExpression[async=true]',
message: 'async functions are not allowed',
},
{
selector: 'ArrowFunctionExpression[async=true]',
message: 'async functions are not allowed',
},
{
selector: 'MethodDefinition[async=true]',
message: 'async methods are not allowed',
},
],
},
overrides: [
{
files: ['*.ts', '*.tsx'],
plugins: ['@typescript-eslint'],
extends: ['plugin:@typescript-eslint/recommended-type-checked', 'airbnb-typescript', 'prettier'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
},
},
],
settings: {
react: {
version: 'detect',
},
},
};
8 changes: 8 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# OSX
.DS_Store

# node.js
node_modules/
npm-debug.log
dist/

File renamed without changes.
Loading

0 comments on commit dcffbae

Please sign in to comment.