Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add code-view source code #3

Closed
wants to merge 7 commits into from
Closed
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
160 changes: 160 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
{
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:prettier/recommended",
"plugin:no-unsanitized/DOM"
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"plugins": [
"unicorn",
"react-hooks",
"no-unsanitized",
"header",
"import"
],
"rules": {
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/consistent-type-definitions": [
"error",
"interface"
],
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"react/display-name": "off",
"react/no-danger": "error",
"react/no-unstable-nested-components": [
"error",
{
"allowAsProps": true
}
],
"react/forbid-component-props": [
"warn",
{
"forbid": [
"className",
"id"
]
}
],
"react/jsx-boolean-value": [
"error",
"always"
],
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "typeLike",
"format": [
"PascalCase"
]
}
],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": [
"error"
],
"unicorn/filename-case": "error",
"curly": "error",
"dot-notation": "error",
"eqeqeq": "error",
"no-return-await": "error",
"require-await": "error",
"header/header": [
"error",
"line",
[
" Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.",
" SPDX-License-Identifier: Apache-2.0"
]
],
"no-restricted-imports": [
"warn",
{
"paths": [
{
"name": "react",
"importNames": [
"default"
],
"message": "Prefer named imports."
}
]
}
],
"sort-imports": [
"error",
{
"ignoreDeclarationSort": true
}
],
"import/order": [
"error",
{
"alphabetize": {
"order": "asc"
}
}
],
"import/no-useless-path-segments": [
"warn",
{
"noUselessIndex": true
}
]
},
"settings": {
"react": {
"version": "detect"
}
},
"env": {
"node": true,
"browser": true,
"es6": true
},
"overrides": [
{
"files": [
"./test/**"
],
"rules": {
// useBrowser is not a React hook
"react-hooks/rules-of-hooks": "off",
"react-hooks/exhaustive-deps": "off",
"no-restricted-imports": "off"
},
"env": {
"jest": true
}
},
{
"files": [
"demo/snippets/*",
"src/internal/base-component/*"
],
"rules": {
"@typescript-eslint/no-explicit-any": "off"
}
},
{
"files": [
"demo/snippets/*",
],
"rules": {
"@typescript-eslint/no-unused-vars": "off"
}
}
],
}
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules
dist
build
.vscode
.cache
coverage
lib
src/test-utils/selectors
src/test-utils/dom/index.ts
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"printWidth": 120
}
Loading