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

Project Structure Update (Packages Upgrade) #226

Merged
merged 6 commits into from
Aug 14, 2024
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
279 changes: 1 addition & 278 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,282 +11,5 @@
"node": true,
"es6": true
},
"plugins": ["@typescript-eslint", "import"],
"overrides": [
{
"files": ["*.js", "*.jsx", "*.ts", "*.tsx"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"airbnb-typescript"
],
"rules": {
"arrow-parens": [
"error",
"always",
{
"requireForBlockBody": true
}
],
"class-methods-use-this": "off",
"comma-dangle": [
"error",
{
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "only-multiline",
"exports": "only-multiline",
"functions": "only-multiline"
}
],
"indent": ["error", 2],
"max-len": ["error", 120],
"no-async-promise-executor": "off",
"no-bitwise": [
"error",
{
"allow": ["~"],
"int32Hint": true
}
],
"no-console": [
"error",
{
"allow": ["warn", "error"]
}
],
"no-multiple-empty-lines": [
"error",
{
"max": 1
}
],
"no-trailing-spaces": "error",
"no-underscore-dangle": [
"error",
{
"allowAfterThis": true
}
],
"operator-linebreak": [
"error",
"after",
{
"overrides": {
"?": "before",
":": "before"
}
}
],
"padding-line-between-statements": [
"error",
{
"blankLine": "always",
"prev": "*",
"next": "return"
},
{
"blankLine": "always",
"prev": ["const", "let", "var"],
"next": "*"
},
{
"blankLine": "any",
"prev": ["const", "let", "var"],
"next": ["const", "let", "var"]
},
{
"blankLine": "always",
"prev": "directive",
"next": "*"
},
{
"blankLine": "any",
"prev": "directive",
"next": "directive"
},
{
"blankLine": "always",
"prev": "block-like",
"next": "*"
},
{
"blankLine": "always",
"prev": ["expression", "multiline-expression"],
"next": "*"
},
{
"blankLine": "any",
"prev": ["expression", "multiline-expression"],
"next": ["expression", "multiline-expression"]
},
{
"blankLine": "always",
"prev": "switch",
"next": "*"
},
{
"blankLine": "always",
"prev": "import",
"next": "*"
},
{
"blankLine": "any",
"prev": "import",
"next": "import"
},
{
"blankLine": "always",
"prev": "*",
"next": "case"
},
{
"blankLine": "any",
"prev": "case",
"next": "case"
},
{
"blankLine": "always",
"prev": "*",
"next": "default"
},
{
"blankLine": "any",
"prev": "case",
"next": "default"
}
],
"prefer-arrow-callback": [
"error",
{
"allowNamedFunctions": true
}
],
"quotes": ["error", "single"],
"quote-props": ["error", "as-needed"],
"import/no-extraneous-dependencies": [
"error",
{
"packageDir": [
"./",
"./packages/core",
"./packages/ng",
"./packages/react"
]
}
],
"import/prefer-default-export": "off"
}
},
{
"files": ["*.js", "*.jsx"],
"rules": {
"no-unused-vars": [
"error",
{
"varsIgnorePattern": "^_",
"argsIgnorePattern": "^_",
"ignoreRestSiblings": true
}
]
}
},
{
"files": ["./scripts/*.js"],
"rules": {
"global-require": "off",
"import/no-dynamic-require": "off",
"@typescript-eslint/no-var-requires": "off"
}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {
"consistent-return": "off",
"indent": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/indent": ["error", 2],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"varsIgnorePattern": "^_",
"argsIgnorePattern": "^_",
"ignoreRestSiblings": true
}
]
}
},
{
"files": ["./packages/icons/**/*.ts"],
"rules": {
"max-len": "off"
}
},
{
"files": ["*.tsx", "*.mdx"],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
}
},
"extends": ["airbnb", "airbnb/hooks", "plugin:react/recommended"],
"plugins": ["react", "react-hooks"],
"settings": {
"react": {
"pragma": "React",
"version": "detect"
}
},
"rules": {
"jsx-a11y/label-has-for": "off",
"import/no-unresolved": "off",
"import/extensions": "off",
"max-len": "off",
"no-undef": "off",
"consistent-return": "off",
"indent": "off",
"prefer-arrow-callback": "off",
"import/no-extraneous-dependencies": "off",
"react/function-component-definition": "off",
"react/require-default-props": "off",
"react/display-name": "off",
"react/jsx-closing-bracket-location": [
"error",
{
"nonEmpty": "tag-aligned",
"selfClosing": "tag-aligned"
}
],
"react/jsx-filename-extension": "off",
"react/jsx-fragments": "off",
"react/jsx-no-target-blank": "off",
"react/jsx-props-no-spreading": "off",
"react/prop-types": "off",
"react/react-in-jsx-scope": "off",
"react/static-property-placement": "off"
}
},
{
"files": ["*.spec.{ts,tsx}", "./packages/react/__test-utils__/**/*"],
"env": {
"jest": true
},
"rules": {
"max-classes-per-file": "off",
"react/jsx-no-constructed-context-values": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-useless-constructor": "off"
}
},
{
"files": ["*.mdx"],
"extends": ["plugin:mdx/recommended"],
"rules": {
"no-unused-vars": "off"
}
}
]
"plugins": ["@typescript-eslint", "import"]
}
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
commitlint --edit $1
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lint-staged
6 changes: 0 additions & 6 deletions .huskyrc.json

This file was deleted.

4 changes: 4 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
'*.@(js|jsx|ts|tsx|html|mdx|json|md)': ['prettier --write'],
'*.@(css|sass|scss)': ['stylelint --fix']
}
3 changes: 1 addition & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
**/dist
/coverage
**/coverage
**/*.ts
**/*.tsx
**/*.css
**/*.scss
/.nx/workspace-data
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"singleQuote": true,
"tabWidth": 2,
"semi": true,
"bracketSpacing": true,
"bracketSameLine": false,
"arrowParens": "always",
"htmlWhitespaceSensitivity": "strict"
}
6 changes: 0 additions & 6 deletions .prettierrc.json

This file was deleted.

28 changes: 12 additions & 16 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,20 @@ const ICONS_PATH = resolve(PACKAGES_PATH, 'icons');

const config: StorybookConfig = {
stories: ['../packages/react/src/**/*.@(mdx|stories.@(mjs|ts|tsx))'],

addons: [
'@storybook/addon-webpack5-compiler-babel',
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-storysource',
'storybook-rytass-palette',
],
framework: {
name: '@storybook/react-webpack5',
options: {
fastRefresh: true,
builder: {
fsCache: true,
lazyCompilation: true,
},
},
},
docs: {
autodocs: 'tag',
},
webpackFinal: config => {

framework: '@storybook/react-webpack5',

webpackFinal: (config) => {
if (config.resolve) {
config.resolve.alias = {
...config.resolve.alias,
'@mezzanine-ui/system': resolve(SYSTEM_PATH, 'src'),
'@mezzanine-ui/core': resolve(CORE_PATH, 'src'),
'@mezzanine-ui/icons': resolve(ICONS_PATH, 'src'),
Expand All @@ -46,6 +37,11 @@ const config: StorybookConfig = {
}

return config;
}
},

typescript: {
reactDocgen: 'react-docgen-typescript',
},
};

export default config;
6 changes: 3 additions & 3 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ const preview: Preview = {
'Navigation',
'Data Entry',
'Data Display',
'Feedback'
]
}
'Feedback',
],
},
},
},
};
Expand Down
1 change: 1 addition & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
*.mdx

prebuilts/
dist/
Loading
Loading