-
Notifications
You must be signed in to change notification settings - Fork 38
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
fix: lint does not work on new Otter webapp #1671
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
packages/@o3r/eslint-config-otter/schematics/index.it.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* Test environment exported by O3rEnvironment, must be first line of the file | ||
* @jest-environment @o3r/test-helpers/jest-environment | ||
* @jest-environment-o3r-app-folder test-app-eslint-config | ||
*/ | ||
const o3rEnvironment = globalThis.o3rEnvironment; | ||
|
||
import { | ||
getDefaultExecSyncOptions, | ||
packageManagerExec, | ||
packageManagerInstall, | ||
packageManagerRunOnProject | ||
} from '@o3r/test-helpers'; | ||
|
||
describe('new otter application with eslint-config', () => { | ||
test('should add eslint-config to existing application', () => { | ||
const { workspacePath, projectName, isInWorkspace, o3rVersion } = o3rEnvironment.testEnvironment; | ||
const execAppOptions = {...getDefaultExecSyncOptions(), cwd: workspacePath}; | ||
packageManagerExec({script: 'ng', args: ['add', `@o3r/eslint-config-otter@${o3rVersion}`, '--skip-confirmation', '--project-name', projectName]}, execAppOptions); | ||
|
||
expect(() => packageManagerInstall(execAppOptions)).not.toThrow(); | ||
expect(() => packageManagerRunOnProject(projectName, isInWorkspace, {script: 'build'}, execAppOptions)).not.toThrow(); | ||
expect(() => packageManagerExec({script: 'ng', args: ['lint', projectName]}, execAppOptions)).not.toThrow('Invalid lint configuration. Nothing to lint.'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 0 additions & 4 deletions
4
.../@o3r/eslint-config-otter/schematics/ng-add/linter/templates/__dot__eslintignore.template
This file was deleted.
Oops, something went wrong.
8 changes: 2 additions & 6 deletions
8
...ibrary/templates/ng/.eslintrc.js.template → ...lates/project/__dot__eslintrc.js.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,15 @@ | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
/* eslint-disable quote-props */ | ||
|
||
module.exports = { | ||
'root': true, | ||
'parserOptions': { | ||
'tsconfigRootDir': __dirname, | ||
'project': [ | ||
'tsconfig.build.json', | ||
'<%= projectTsConfig %>.json', | ||
'tsconfig.spec.json', | ||
'tsconfig.builders.json', | ||
'tsconfig.eslint.json' | ||
], | ||
'sourceType': 'module' | ||
}, | ||
'extends': [ | ||
'<%= eslintRcPath %>' | ||
'<%= rootRelativePath %>/.eslintrc.js' | ||
] | ||
}; |
6 changes: 6 additions & 0 deletions
6
.../@o3r/eslint-config-otter/schematics/ng-add/linter/templates/project/tsconfig.eslint.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"extends": "./<%= projectTsConfig %>", | ||
"include": [ | ||
".eslintrc.js" | ||
] | ||
} |
9 changes: 0 additions & 9 deletions
9
packages/@o3r/eslint-config-otter/schematics/ng-add/linter/templates/tsconfig.eslint.json
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
...nt-config-otter/schematics/ng-add/linter/templates/workspace/__dot__eslintignore.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/node_modules | ||
**/dist | ||
**/dist-* | ||
**/test | ||
**/tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const { join } = require('node:path'); | ||
const getJestConfig = require('../../../../jest.config.it').getJestConfig; | ||
|
||
/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ | ||
module.exports = { | ||
...getJestConfig(join(__dirname, '..')), | ||
displayName: require('../package.json').name | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
} | ||
], | ||
"include": [ | ||
"./src/**/*.spec.ts", | ||
"**/*.spec.ts" | ||
], | ||
"exclude": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
packages/@o3r/workspace/schematics/library/templates/ng/tsconfig.eslint.json.template
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if it extends a config that extends '@o3r/eslint-config-otter'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is a corner case that isn't currently covered
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#1695