Skip to content

Commit

Permalink
add js extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Jan 6, 2024
1 parent 2f8e50a commit 827a9c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion generators/bootstrap/support/eslint-transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ import { Minimatch } from 'minimatch';

import BaseGenerator from '../../base-core/index.js';
import { getPackageRoot } from '../../../lib/index.js';
import { JS_PRETTIER_EXTENSIONS } from '../../generator-constants.js';

// eslint-disable-next-line import/prefer-default-export
export const createESLintTransform = function (
this: BaseGenerator | void,
transformOptions: { ignoreErrors?: boolean; extensions?: string } = {},
) {
const { extensions = 'js,ts', ignoreErrors } = transformOptions;
const { extensions = JS_PRETTIER_EXTENSIONS, ignoreErrors } = transformOptions;
const minimatch = new Minimatch(`**/*.{${extensions}}`, { dot: true });
const eslint = new ESLint.ESLint({
fix: true,
Expand Down
3 changes: 2 additions & 1 deletion generators/generator-constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,5 @@ export const SERVER_MAIN_SRC_DIR = `${MAIN_DIR}java/`;
export const SERVER_MAIN_RES_DIR = `${MAIN_DIR}resources/`;
export const SERVER_TEST_SRC_DIR = `${TEST_DIR}java/`;
export const SERVER_TEST_RES_DIR = `${TEST_DIR}resources/`;
export const PRETTIER_EXTENSIONS = 'md,json,yml,html,cjs,mjs,js,ts,tsx,css,scss,vue,java';
export const JS_PRETTIER_EXTENSIONS = 'cjs,mjs,js,cts,mts,ts';
export const PRETTIER_EXTENSIONS = `md,json,yml,html,${JS_PRETTIER_EXTENSIONS},tsx,css,scss,vue,java`;

0 comments on commit 827a9c7

Please sign in to comment.