-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: lint does not work on new Otter webapp
- Loading branch information
1 parent
10bd5c0
commit ffe96dd
Showing
21 changed files
with
140 additions
and
59 deletions.
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
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