2.1.1 • Published 10 months ago

@jihyunlab/prettier-config v2.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@jihyunlab/prettier-config

Version Downloads Last commit License Linter code style: prettier\ Build Lint Prettier

@jihyunlab/prettier-config provides Prettier config for TypeScript.

Installation

npm i --save-dev @jihyunlab/prettier-config prettier eslint-config-prettier eslint-plugin-prettier

Configuration

Configure Prettier

Create and edit the prettier.config.mjs file.

├─ prettier.config.mjs
└─ ...
import { jihyunlabPrettierConfig } from '@jihyunlab/prettier-config';

export default {
  ...jihyunlabPrettierConfig,
};

Configure Prettier Ignore

Create and edit the .prettierignore file.

├─ .prettierignore
└─ ...
/node_modules
/build
/dist
/coverage

Configure ESLint for Prettier

When using ESLint, edit the eslint.config.mjs file.\ For ESLint installation and configuration, see @jihyunlab/eslint-config.

├─ eslint.config.mjs
└─ ...
import eslint from '@eslint/js';
import tsEslint from 'typescript-eslint';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import { jihyunlabEslintConfig } from '@jihyunlab/eslint-config';

export default tsEslint.config(
  {
    ignores: ['node_modules', 'dist', 'build', 'coverage'],
  },
  {
    languageOptions: {
      parserOptions: {
        project: './tsconfig.eslint.json',
        tsconfigRootDir: import.meta.dirname,
      },
    },
  },
  {
    files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],
    extends: [
      eslint.configs.recommended,
      ...tsEslint.configs.recommendedTypeChecked,
      jihyunlabEslintConfig,
      eslintPluginPrettierRecommended,
    ],
  }
);

Configure VSCode for Prettier

When using VSCode, create and edit the .vscode/settings.json file.

├─ .vscode
│  └─ settings.json
└─ ...
{
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.formatOnSave": true
}

Credits

Authored and maintained by JihyunLab <info@jihyunlab.com>

License

Open source licensed as MIT.

2.1.1

10 months ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.8

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago