-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from mParticle/feat/automated-formatting-and-l…
…inting style: Automated formatting and linting [PR #4 - Linting and Formatting]
- Loading branch information
Showing
162 changed files
with
7,906 additions
and
5,130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es2024: true, | ||
}, | ||
settings: { | ||
react: { | ||
version: 'detect', | ||
}, | ||
}, | ||
extends: ['standard-with-typescript', 'eslint:recommended', 'plugin:react/recommended', 'prettier'], | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
extraFileExtensions: ['.md', '.css'], | ||
}, | ||
plugins: ['react', 'react-hooks'], | ||
ignorePatterns: ['.eslintrc.js'], | ||
rules: { | ||
'@typescript-eslint/explicit-function-return-type': [ | ||
'warn', | ||
{ | ||
allowedNames: [ | ||
'Button', | ||
'FloatButton', | ||
'Icon', | ||
'Rate', | ||
'Form', | ||
'TreeSelect', | ||
'Select', | ||
'Mentions', | ||
'Radio', | ||
'ColorPicker', | ||
'Slider', | ||
'Cascader', | ||
'DatePicker', | ||
'Checkbox', | ||
'Input', | ||
'InputNumber', | ||
'Switch', | ||
'Upload', | ||
'AutoComplete', | ||
'TimePicker', | ||
'Transfer', | ||
'Collapse', | ||
'Timeline', | ||
'Calendar', | ||
'Segmented', | ||
'Tabs', | ||
'Tag', | ||
'Tour', | ||
'Carousel', | ||
'Tooltip', | ||
'Statistic', | ||
'Tree', | ||
'Image', | ||
'QRCode', | ||
'Badge', | ||
'Card', | ||
'Avatar', | ||
'Descriptions', | ||
'Table', | ||
'Empty', | ||
'Popover', | ||
'List', | ||
'Progress', | ||
'Result', | ||
'Spin', | ||
'Skeleton', | ||
'Watermark', | ||
'Popconfirm', | ||
'Drawer', | ||
'Modal', | ||
'Notification', | ||
'Alert', | ||
'Message', | ||
'LoadingModal', | ||
'Flex', | ||
'Space', | ||
'Layout', | ||
'Grid', | ||
'Divider', | ||
'Steps', | ||
'Anchor', | ||
'Dropdown', | ||
'Breadcrumb', | ||
'Pagination', | ||
'Menu', | ||
'ConfigProvider', | ||
'Affix', | ||
'App', | ||
], | ||
}, | ||
], | ||
'@typescript-eslint/strict-boolean-expressions': 'off', | ||
'@typescript-eslint/consistent-type-definitions': 'off', | ||
'@typescript-eslint/no-use-before-define': ['error', { allowNamedExports: true }], | ||
'react/react-in-jsx-scope': 'off', | ||
'import/no-duplicates': 'off', | ||
}, | ||
globals: { | ||
React: true, | ||
expect: true, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
name: "Dependabot Automerge" | ||
name: 'Dependabot Automerge' | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
automerge-dependabot: | ||
name: "Automerge Dependabot PR" | ||
uses: mParticle/mparticle-workflows/.github/workflows/dependabot-automerge.yml@stable | ||
name: 'Automerge Dependabot PR' | ||
uses: mParticle/mparticle-workflows/.github/workflows/dependabot-automerge.yml@stable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,58 @@ | ||
name: Release Aquarium | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
# release is done from main branch. | ||
confirm-public-repo-main-branch: | ||
name: 'Confirm release is run from public/main branch' | ||
uses: mParticle/mparticle-workflows/.github/workflows/sdk-release-repo-branch-check.yml@main | ||
|
||
release: | ||
name: Perform Release | ||
runs-on: ubuntu-latest | ||
needs: confirm-public-repo-main-branch | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GIT_AUTHOR_NAME: mparticle-automation | ||
GIT_AUTHOR_EMAIL: developers@mparticle.com | ||
GIT_COMMITTER_NAME: mparticle-automation | ||
GIT_COMMITTER_EMAIL: developers@mparticle.com | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
steps: | ||
- name: Checkout public main branch | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: main | ||
|
||
- name: Import GPG Key | ||
uses: crazy-max/ghaction-import-gpg@v4 | ||
with: | ||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.GPG_PASSPHRASE }} | ||
git_user_signingkey: true | ||
git_commit_gpgsign: true | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: latest | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Build dist | ||
run: npm run build-dist | ||
|
||
- name: Release | ||
run: | | ||
npx semantic-release | ||
- name: Archive npm failure logs | ||
uses: actions/upload-artifact@v3 | ||
if: failure() | ||
with: | ||
name: npm-logs | ||
path: ~/.npm/_logs | ||
# release is done from main branch. | ||
confirm-public-repo-main-branch: | ||
name: 'Confirm release is run from public/main branch' | ||
uses: mParticle/mparticle-workflows/.github/workflows/sdk-release-repo-branch-check.yml@main | ||
|
||
release: | ||
name: Perform Release | ||
runs-on: ubuntu-latest | ||
needs: confirm-public-repo-main-branch | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GIT_AUTHOR_NAME: mparticle-automation | ||
GIT_AUTHOR_EMAIL: developers@mparticle.com | ||
GIT_COMMITTER_NAME: mparticle-automation | ||
GIT_COMMITTER_EMAIL: developers@mparticle.com | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
steps: | ||
- name: Checkout public main branch | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: main | ||
|
||
- name: Import GPG Key | ||
uses: crazy-max/ghaction-import-gpg@v4 | ||
with: | ||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.GPG_PASSPHRASE }} | ||
git_user_signingkey: true | ||
git_commit_gpgsign: true | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Build dist | ||
run: npm run build-dist | ||
|
||
- name: Release | ||
run: | | ||
npx semantic-release | ||
- name: Archive npm failure logs | ||
uses: actions/upload-artifact@v3 | ||
if: failure() | ||
with: | ||
name: npm-logs | ||
path: ~/.npm/_logs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx lint-staged |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"semi": false, | ||
"singleQuote": true, | ||
"arrowParens": "avoid", | ||
"printWidth": 120 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,34 @@ | ||
import type { StorybookConfig } from "@storybook/react-vite"; | ||
import type { StorybookConfig } from '@storybook/react-vite' | ||
import react from '@vitejs/plugin-react' | ||
import { PluginOption, Plugin } from 'vite' | ||
import { withoutVitePlugins } from '@storybook/builder-vite' | ||
|
||
type StorybookVitePlugins = { plugins: (PluginOption[] | Plugin)[]; }; | ||
type StorybookVitePlugins = { plugins: (PluginOption[] | Plugin)[] } | ||
|
||
const config: StorybookConfig & StorybookVitePlugins = { | ||
framework: "@storybook/react-vite", | ||
framework: '@storybook/react-vite', | ||
|
||
stories: [ | ||
"../src/**/*.mdx", | ||
"../src/**/*.stories.@(ts|tsx)", | ||
], | ||
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(ts|tsx)'], | ||
|
||
addons: [ | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials", | ||
"@storybook/addon-interactions", | ||
], | ||
addons: ['@storybook/addon-links', '@storybook/addon-essentials', '@storybook/addon-interactions'], | ||
|
||
docs: { | ||
autodocs: true, | ||
defaultName: "Documentation", | ||
defaultName: 'Documentation', | ||
}, | ||
|
||
plugins: [react()], | ||
|
||
async viteFinal(config) { | ||
return ({ | ||
return { | ||
...config, | ||
plugins: await withoutVitePlugins(config.plugins, ["vite:dts"]), | ||
}); | ||
plugins: await withoutVitePlugins(config.plugins, ['vite:dts']), | ||
} | ||
}, | ||
|
||
core: { | ||
disableTelemetry: true, // requested by security | ||
disableTelemetry: true, // requested by security | ||
}, | ||
}; | ||
} | ||
|
||
export default config; | ||
export default config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.