Skip to content

3.0.0

Compare
Choose a tag to compare
@amanteaux amanteaux released this 23 Oct 10:32
· 121 commits to master since this release

Changelog

  • Use SCSS modules
  • Add ESLint rules to TS type delimiter and type definition
  • Specify node minimum version in package.json
  • Upgrade vite and yarn
  • React hooks alias simplification
  • Add Storybook

Upgrade instructions (for an existing project)

Add ESLint configuration

To avoid have issues with Google Translate, add extends: 'plugin:@sayari/recommended'

To avoid have issues with hooks, add plugins: 'react-hooks'

To uniformize TS type members delimiter (comma instead of semicolon), to force explicit type definition, add rules:

    // Uniformize TS type members delimiter (comma instead of semicolon)
    "@typescript-eslint/member-delimiter-style": ["error", {
      "multiline": {
        "delimiter": "comma",
        "requireLast": true
      },
      "singleline": {
        "delimiter": "comma",
        "requireLast": false
      }
    }],
    // Force explicit type definition
    '@typescript-eslint/typedef': [
      'error',
      {
        'arrayDestructuring': false,
        'arrowCallSignature': true,
        'arrowParameter': true,
        'callSignature': true,
        'memberVariableDeclaration': true,
        'parameter': true,
        'propertyDeclaration': true,
        'objectDestructuring': false,
        'variableDeclaration': true,
        'variableDeclarationIgnoreFunction': true
      }
    ],
    'react-hooks/rules-of-hooks': 'error',
    // Add all your custom hooks which have dependencies in the additional hooks
    // If you have several hooks, here is the syntax 'additionalHooks': '(hook1|hook2)'
    'react-hooks/exhaustive-deps': ['warn', { 'additionalHooks': 'useOnDependenciesChange|useEffectWithSsrSupport|useObservableLoader' }],

Node engine minimum version

Specify node engine minimum version in the package.json file to avoid having node related issues:

  "engines": {
    "node": "~18"
  }

SCSS modules support and Storybook

See 6ede25a...25c8521