dotansimha / dotansimha/graphql-code-generator
git generates: warning: LF will be replaced by CRLF in src/graphql/generated/fragment-matcher.ts
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 1.4k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 23
Description
**Describe the bug**
Whenever we create a new file with extension `.graphql` and run `graphql-codegen` to generate the required files for typescript we get the following error from git:

**To Reproduce**
- Create a file `test.graphql` on a Windows machine
- Run `graphql-codegen`
- Add the newly generated files to git `git add .`
> Notice line ending warnings
The GraphQL generated code can be found [here](https://github.com/DarkLite1/hip/tree/master/src/graphql).
2. My `codegen.js` config file:
```javascript
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-var-requires */
const fs = require('fs')
const token = fs.readFileSync('./token.txt')
module.exports = {
overwrite: true,
schema: {
[process.env.BACKEND_API_URI]: {
headers: {
Authorization: `Bearer ${token}`,
},
},
},
documents: 'src/**/*.graphql',
hooks: {
afterAllFileWrite: ['prettier --write'],
},
generates: {
'src/graphql/generated/schema.json': {
plugins: ['introspection'],
},
'src/graphql/generated/operations.ts': {
plugins: [
{
add: {
content: '/* eslint-disable */',
},
},
'typescript',
'typescript-operations',
'typescript-vue-apollo',
],
config: { withCompositionFunctions: true },
},
'src/graphql/generated/fragment-matcher.ts': ['fragment-matcher'],
},
}
```
**Expected behavior**
No line ending warnings as this isn't happening for manually created files.
**Environment:**
- OS: Windows Server 2016
- `@graphql-codegen/...`:
```
"@graphql-codegen/add": "^2.0.2",
"@graphql-codegen/cli": "^1.19.4",
"@graphql-codegen/fragment-matcher": "2.0.1",
"@graphql-codegen/introspection": "1.18.1",
"@graphql-codegen/typescript": "^1.19.0",
"@graphql-codegen/typescript-operations": "^1.17.12",
"@graphql-codegen/typescript-vue-apollo": "^2.3.1",
```
- NodeJS: v12.18.1
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.