Skip to content

Commit

Permalink
Add example directories similar to e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel7grant committed Aug 5, 2024
1 parent 83d5adf commit 93c1abe
Show file tree
Hide file tree
Showing 11 changed files with 5,813 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,15 @@ jobs:
run: npm test
- name: Build TypeScript files
run: npm run build
- name: Test ESLint 9 example for compatibility
run: |
cd examples/recommended
npm ci
(npm run lint || true) | grep -aq "Type of name in User is not matching the TypeORM column type (expected type: string)"
- name: Test legacy example for compatibility
run: |
# Workaround until they fix scoping
mv eslint.config.mjs _eslint.config.mjs
cd examples/legacy
npm ci
(npm run lint || true) | grep -aq "Type of name in User is not matching the TypeORM column type (expected type: string)"
11 changes: 11 additions & 0 deletions examples/legacy/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'typeorm-typescript'],
root: true,
rules: {
'typeorm-typescript/enforce-column-types': 'error',
'typeorm-typescript/enforce-relation-types': 'error',
'typeorm-typescript/enforce-consistent-nullability': 'error',
},
};
7 changes: 7 additions & 0 deletions examples/legacy/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Entity, Column } from 'typeorm';

@Entity({ name: 'User' })
export class User {
@Column({ type: 'string' })
name: number;
}
Loading

0 comments on commit 93c1abe

Please sign in to comment.