@ignit/style-guide
v1.10.0
Published
Shareable style guide
Readme
Style Guide
NOTE: Requires ESLint 9+
Eslint
Create eslint.config.js in project root and add the following
import tsParser from '@typescript-eslint/parser'
import ignitStyleGuideCore from '@ignit/style-guide/src/eslint/core.mjs'
// VUE: import ignitStyleGuideVue from '@ignit/style-guide/src/eslint/vue.mjs'
// REACT: import ignitStyleGuideReact from '@ignit/style-guide/src/eslint/react.mjs'
// NEXT: import ignitStyleGuideNext from '@ignit/style-guide/src/eslint/next.mjs'
/** @type { import('@types/eslint').} */
export default [
...ignitStyleGuideCore,
// VUE: ...ignitStyleGuideVue.map((config) => ({ ...config, files: ['**/*.vue'] })),
// REACT: ...ignitStyleGuideReact.map((config) => ({ ...config, files: ['**/*.jsx', '**/*.tsx'] })),
// NEXT: ...ignitStyleGuideNext.map((config) => ({ ...config, files: ['**/*.jsx', '**/*.tsx'] })),
{
files: ['**/*.ts', '**/*.js'],
languageOptions: {
parser: tsParser,
parserOptions: {
project: './tsconfig.json'
}
}
}
// REACT: Add this for JSX/TSX files:
// {
// files: ['**/*.jsx'],
// languageOptions: {
// ecmaVersion: 2020,
// sourceType: 'module',
// parserOptions: {
// ecmaFeatures: { jsx: true }
// }
// }
// },
// {
// files: ['**/*.tsx'],
// languageOptions: {
// parser: tsParser,
// ecmaVersion: 2020,
// sourceType: 'module',
// parserOptions: {
// project: './tsconfig.json',
// ecmaFeatures: { jsx: true }
// }
// }
// }
]Create .prettierrc.js in project root and add the following
Prettier
import config from '@ignit/style-guide/src/prettier/index.mjs'
/** @type { import('prettier').Config } */
export default {
...config
}