Skip to content

Commit

Permalink
first pass the repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmars committed Dec 14, 2023
1 parent c00d6ae commit e5a7d64
Show file tree
Hide file tree
Showing 36 changed files with 40,530 additions and 202 deletions.
8 changes: 8 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
webpack.config.js
src/helpers/config_access.js
*.html
*.css
*.json
*.md
*.svg
*.zip
191 changes: 191 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
{
"root": true,
"extends": ["@pega"],
"parserOptions": {
"project": "tsconfig.json",
"ecmaVersion": 13
},
"settings": {
"import/resolver": {
"typescript": {},
"node": {
"extensions": [".js", ".jsx"]
}
},
"react": {
"version": "detect"
}
},
"ignorePatterns": ["node_modules", "packages/*/lib", "!.storybook", ".storybook/public"],
"rules": {
// Prettier recommends running separately from a linter.
// https://prettier.io/docs/en/integrating-with-linters.html#notes
"prettier/prettier": "off",

// Disable rules from shared configs we're not ready for yet.
"sonarjs/cognitive-complexity": "off",
"sonarjs/no-identical-functions": "off",
"sonarjs/no-duplicate-string": "off",
"sonarjs/no-nested-template-literals": "off",

//
// JA - Override some default lint handling here
"@typescript-eslint/array-type": ["error", { "default": "generic" }],
// "import/extensions": ["warn", "never"], // Turning off for now (see below)

//
// Initial release: turning these off; phase in to "warn" or "error" over time
// For "quotes" and "@typescript-eslint/quotes", see override below for .ts/.tsx files
"import/extensions": ["off", "never"],
"import/named": "off",
"import/no-cycle": "off",
"import/no-duplicates": "off",
"import/no-extraneous-dependencies": "off",
"import/no-named-as-default": "off",
"import/no-named-as-default-member": "off",
"import/no-self-import": "off",
"import/no-unresolved": "off",
"import/no-useless-path-segments": "off",
"import/order": "off",

"no-else-return": "off",
"no-restricted-syntax": "off",
"no-underscore-dangle": "off",

"jsx-a11y/alt-text": "off",
"jsx-a11y/anchor-is-valid": "off",
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/label-has-associated-control": "off",
"jsx-a11y/no-static-element-interactions": "off",

"react/jsx-fragments": "off",
"react/jsx-no-bind": "off",
"react/self-closing-comp": "off",

"sonarjs/prefer-immediate-return": "off",

"@typescript-eslint/dot-notation": "off", // prefer warn but needs different parserOptions
"@typescript-eslint/naming-convention": "off", // prefer warn but needs different parserOptions
"@typescript-eslint/ban-types": "off", // also, see override below

//
// Initial release: set to error
"@typescript-eslint/no-inferrable-types": "error",
"eqeqeq": "error",
"no-alert": "error",
"no-console": "error",
"no-fallthrough": "error",
"no-undef": "error",
"no-unused-vars": "error",
"no-var": "error",
"prefer-const": "error",
"yoda": "error",

"import/no-mutable-exports": "error",
"sonarjs/max-switch-cases": "error",
"sonarjs/no-collapsible-if": "error",
"sonarjs/no-all-duplicated-branches": "error",
"sonarjs/no-duplicated-branches": "error",
"sonarjs/no-gratuitous-expressions": "error",
"sonarjs/no-ignored-return": "error",
"sonarjs/no-small-switch": "error",
"sonarjs/prefer-object-literal": "error",
"sonarjs/prefer-single-boolean-return": "error",
"@typescript-eslint/no-shadow": "error",
"react/default-props-match-prop-types": "error",
"react/no-unescaped-entities": "error",
"react/no-unused-prop-types": "error",
"react/static-property-placement": "error",
"array-callback-return": "error",
"camelcase": "error",
"default-case": "error",
"func-names": "error",
"no-case-declarations": "error",
"no-lonely-if": "error",
"no-nested-ternary": "error",
"no-plusplus": "error",
"no-restricted-globals": "error",
"no-restricted-properties": "error",
"no-shadow": "error",
"radix": "error",
"spaced-comment": "error",

"import/newline-after-import": "error",
"sonarjs/no-nested-switch": "error",
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-empty-function": "error",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-useless-constructor": "error",
"react/button-has-type": "error",
"react/jsx-curly-brace-presence": "error",
"react/jsx-boolean-value": "error",
"react/no-array-index-key": "error",
"class-methods-use-this": "error",
"guard-for-in": "error",
"no-unneeded-ternary": "error",
"no-unused-expressions": "error",
"operator-assignment": "error",
"prefer-template": "error",
"vars-on-top": "error",

"no-use-before-define": "off", // doc for @typescript-eslint/no-use-before-define says to turn off the base implementation
"@typescript-eslint/no-use-before-define": "error"
},
"overrides": [
{
"files": "*.@(ts|tsx)",
"rules": {
"@typescript-eslint/method-signature-style": ["error", "property"],
// "@typescript-eslint/ban-types": [
// "warn",
// {
// "types": {
// "Omit": "Please use the 'OmitStrict' type from 'src/types/' instead.",
// "object": false,
// "Function": false
// },
// "extendDefaults": true
// }
// ],

"quotes": "off",
"@typescript-eslint/quotes": "off"
// [
// "error",
// "single",
// {
// "avoidEscape": true,
// "allowTemplateLiterals": false
// }
// ]
}
},
{
"files": "*.@(jsx|tsx|mdx)",
"rules": {
"react/react-in-jsx-scope": "off",
// Set up configuration for future sweep
"react-hooks/exhaustive-deps": [
"off",
{
"additionalHooks": "useAfterInitialEffect"
}
]
}
},
{
"files": "*.@(js|jsx|ts|tsx|mdx)",
"rules": {}
},
{
"files": ".storybook/*.js",
"extends": ["@pega/eslint-config/script"]
},
{
"files": "*/**/mocks/**.@(mocks|styles).@(tsx|ts)",
"rules": {
"import/prefer-default-export": ["off"]
}
}
]
}
130 changes: 130 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
8 changes: 8 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Use default npmjs registry for the SDKs
registry = https://registry.npmjs.org/
# For now, turn off npm auto-install of peer dependencies to get rid of warnings
legacy-peer-deps=true
# Turn off messages such as > [email protected] list and > dx-component-builder-sdk list
loglevel=silent
#
#
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@pega/prettier-config"
7 changes: 7 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
stories: ['../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: ['@storybook/addon-knobs'],
core: {
builder: 'webpack5'
}
};
16 changes: 16 additions & 0 deletions .storybook/pega-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e5a7d64

Please sign in to comment.