Skip to content

Commit 2c9f313

Browse files
committedApr 8, 2024
fix: create piece cli lint issue
1 parent 85be96d commit 2c9f313

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed
 

‎.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
node_modules
2+
deploy

‎.eslintrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"root": true,
3-
"ignorePatterns": ["**/*"],
3+
"ignorePatterns": ["**/*", "deploy/**/*"],
44
"plugins": ["@nx"],
55
"overrides": [
66
{

‎nx.json

+5
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@
3535
"@nx/eslint:lint": {
3636
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"],
3737
"cache": true
38+
},
39+
"@nx/js:tsc": {
40+
"cache": true,
41+
"dependsOn": ["^build"],
42+
"inputs": ["production", "^production"]
3843
}
3944
},
4045
"namedInputs": {

‎packages/cli/src/lib/commands/create-piece.ts

+8-7
Original file line numberDiff line numberDiff line change
@@ -127,18 +127,19 @@ const updateProjectJsonConfig = async (
127127
projectJson.targets.build.options.updateBuildableProjectDepsInPackageJson =
128128
true;
129129

130-
if (projectJson.targets.lint) {
131-
const lintFilePatterns = projectJson.targets.lint.options.lintFilePatterns;
130+
const lintFilePatterns = projectJson.targets.lint?.options?.lintFilePatterns;
131+
132+
if (lintFilePatterns) {
132133
const patternIndex = lintFilePatterns.findIndex((item) =>
133134
item.endsWith('package.json')
134135
);
135136
if (patternIndex !== -1) lintFilePatterns?.splice(patternIndex, 1);
136137
} else {
137-
projectJson.targets.lint = {
138-
executor: '@nx/eslint:lint',
139-
outputs: ['{options.outputFile}'],
140-
};
141-
}
138+
projectJson.targets.lint = {
139+
executor: '@nx/eslint:lint',
140+
outputs: ['{options.outputFile}'],
141+
};
142+
}
142143

143144
await writeProjectJson(
144145
`packages/pieces/${pieceType}/${pieceName}`,

0 commit comments

Comments
 (0)
Please sign in to comment.