Skip to content

Commit

Permalink
chore: update lint/configuration flow
Browse files Browse the repository at this point in the history
  • Loading branch information
nullswan and thibaudlabat committed Jul 28, 2022
1 parent 7c3633d commit 8b75afe
Show file tree
Hide file tree
Showing 11 changed files with 82 additions and 68 deletions.
26 changes: 0 additions & 26 deletions .eslintrc.cjs

This file was deleted.

14 changes: 14 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"rules": {}
}
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ jobs:
- name: Run tests
if: always()
run: npm test

8 changes: 5 additions & 3 deletions .hooks/commit-msg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"steps": [{
"steps": [
{
"name": "commit lint",
"command": "cat {args} | ./node_modules/@commitlint/cli/cli.js"
}]
}
}
]
}
2 changes: 1 addition & 1 deletion .hooks/pre-commit.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"command": "npm run lint-fix"
}
]
}
}
2 changes: 1 addition & 1 deletion .mookme.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"packagesPath": ".",
"packages": [],
"addedBehavior": "addAndCommit"
}
}
16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch via Yarn",
"runtimeExecutable": "yarn",
"cwd": "${workspaceFolder}",
"runtimeArgs": ["example"]
}
]
}
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
# GraphQL-Armor [![CI](https://github.com/Escape-Technologies/graphql-armor/actions/workflows/ci.yaml/badge.svg)](https://github.com/Escape-Technologies/graphql-armor/actions/workflows/ci.yaml)

## Usage

```typescript
import { Armor } from '../src';
const armor = new Armor({});

const server = armor.apolloServer({
typeDefs,
resolvers,
cache: 'bounded',
plugins: [ApolloServerPluginDrainHttpServer({ httpServer })],
});
```
26 changes: 15 additions & 11 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
const Configuration = {
/*
* Resolve and load @commitlint/config-conventional from node_modules.
* Referenced packages must be installed
*/
* Resolve and load @commitlint/config-conventional from node_modules.
* Referenced packages must be installed
*/
extends: ['@commitlint/config-angular'],
/*
* Resolve and load @commitlint/format from node_modules.
* Referenced package must be installed
*/
* Resolve and load @commitlint/format from node_modules.
* Referenced package must be installed
*/
formatter: '@commitlint/format',
/*
* Whether commitlint uses the default ignore rules.
*/
* Whether commitlint uses the default ignore rules.
*/
defaultIgnores: true,
/*
* Custom URL to show upon failure
*/
* Custom URL to show upon failure
*/
helpUrl:
'https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#-commit-message-guidelines',
rules: {
'type-enum': [2, 'always', ['ci', 'docs', 'feat', 'fix', 'refactor', 'test', 'chore']],
'type-enum': [
2,
'always',
['ci', 'docs', 'feat', 'fix', 'refactor', 'test', 'chore'],
],
},
};

Expand Down
15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
"watch": "tsc -p tsconfig.json -w",
"start": "NODE_PATH=dist node dist/index.js",
"test": "echo 'NotImplementedError'",
"lint": "npx eslint src/**/*.ts",
"lint-fix": "npx eslint --fix src/**/*.ts",
"example": "nodemon examples/server.ts"
"lint": "yarn prettier . -uw --single-quote",
"example": "nodemon --delay 500ms examples/server.ts"
},
"repository": {
"type": "git",
Expand All @@ -26,14 +25,18 @@
"apollo-server": "^3.10.0",
"apollo-server-express": "^3.10.0",
"express": "^4.18.1",
"http": "^0.0.1-security"
"graphql": "^16.5.0",
"graphql-validation-complexity": "^0.4.2",
"http": "^0.0.1-security",
"prettier": "^2.7.1",
"selectn": "^1.1.2"
},
"devDependencies": {
"@commitlint/cli": "^17.0.0",
"@commitlint/config-angular": "^17.0.0",
"@escape.tech/mookme": "^2.1.1",
"@typescript-eslint/eslint-plugin": "^5.25.0",
"@typescript-eslint/parser": "^5.25.0",
"@typescript-eslint/eslint-plugin": "^5.31.0",
"@typescript-eslint/parser": "^5.31.0",
"eslint": ">=8.15.0",
"eslint-config-google": "^0.14.0",
"nodemon": "^2.0.19",
Expand Down
26 changes: 7 additions & 19 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,16 @@
"moduleResolution": "node",
"baseUrl": "src",
"target": "es2022",
"lib": [
"es6",
"dom"
],
"lib": ["es6", "dom"],
"outDir": "./dist",
"sourceMap": true,
"types": [
"node",
],
"typeRoots": [
"node_modules/@types"
],
"types": ["node"],
"typeRoots": ["node_modules/@types"],
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"resolveJsonModule": true,
"strictNullChecks": true,
"strictNullChecks": true
},
"exclude": [
"node_modules",
"dist"
],
"include": [
"src"
]
}
"exclude": ["node_modules", "dist"],
"include": ["src"]
}

0 comments on commit 8b75afe

Please sign in to comment.