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

Initial setup #1

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Initial setup #1

wants to merge 6 commits into from

Conversation

paescuj
Copy link
Member

@paescuj paescuj commented Aug 1, 2024

Initial setup for @directus/eslint-config - a ESLint config preset which can be used across all JavaScript repos within the Directus organization for a simple setup and consistent linting & formatting experience


  • The preset is heavily based on Anthony's ESLint config preset (https://github.com/antfu/eslint-config)
    • Formatting without Prettier for more flexible code structuring, see https://antfu.me/posts/why-not-prettier
    • Comprehensive ruleset, reasonable defaults
    • Typed rules
    • Support for formatting & linting of other files besides JS, all via ESLint (no separate Prettier setup required)
  • Lint rules have been adopted from directus/directus → .eslintrc.js
  • Format rules have been adopted from directus/directus → .prettierrc.json
  • It's leveraging the flat config format, which is the new default since ESLint v9
  • TypeScript support is enabled by default, Vue support is disabled and can be enabled via options:
    export default directusConfig({ vue: true });
  • Additionally, repo based ESLint config can be defined via options (typed):
    export default directusConfig({
    	eslintConfig: {
    		ignores: ['src/templates/example.js'],
    	},
    });

  • Repo is dogfooding, which helps to verify the setup
  • Included workflows:
    • Check: Lint and Typecheck
    • Release: Create new version by dispatching this workflow

@paescuj paescuj marked this pull request as ready for review August 2, 2024 11:38
@paescuj paescuj requested a review from wrynegade August 2, 2024 11:44
@paescuj paescuj force-pushed the init branch 9 times, most recently from ea663b5 to c195560 Compare August 8, 2024 09:26
@paescuj paescuj force-pushed the init branch 4 times, most recently from bee2604 to 393e15a Compare August 16, 2024 20:08
@paescuj paescuj force-pushed the init branch 3 times, most recently from d1bd81e to 154001e Compare August 22, 2024 08:36
@paescuj paescuj force-pushed the init branch 5 times, most recently from 55a3b4a to 39b05d0 Compare September 15, 2024 21:57
@paescuj paescuj force-pushed the init branch 3 times, most recently from f54aa9b to 88825af Compare September 28, 2024 17:40
@paescuj paescuj force-pushed the init branch 2 times, most recently from 71cbc3d to 565eae2 Compare October 18, 2024 14:22
readme.md Outdated Show resolved Hide resolved
license Outdated Show resolved Hide resolved
Co-authored-by: Hannes Küttner <[email protected]>
package.json Outdated Show resolved Hide resolved
@paescuj paescuj marked this pull request as draft January 13, 2025 13:56
"@antfu/eslint-config": "3.11.2",
"eslint-flat-config-utils": "0.4.0",
"eslint-plugin-format": "0.1.3",
"prettier": "3.4.1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason prettier is in here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants