Skip to content

Commit

Permalink
refactor: support inrupt coding standards
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimvh committed May 25, 2020
1 parent 5def531 commit f8e136c
Show file tree
Hide file tree
Showing 25 changed files with 722 additions and 604 deletions.
7 changes: 1 addition & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,16 @@ module.exports = {
project: ['./tsconfig.json'],
},
plugins: [
'@typescript-eslint',
'prettier',
'eslint-plugin-tsdoc',
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'es/node',
'prettier', // disables rules from the above that conflict with prettier
'plugin:prettier/recommended', // adds prettier rules
],
rules: {
'@typescript-eslint/no-empty-interface': 'off',
'prettier/prettier': 'error',
"sort-imports": "error",
'tsdoc/syntax': 'error',
},
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ coverage
*.d.ts

!.eslintrc.js
!test/eslintrc.js
!jest.config.js
1,289 changes: 697 additions & 592 deletions package-lock.json

Large diffs are not rendered by default.

15 changes: 13 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,19 @@
"scripts": {
"build": "tsc",
"lint": "eslint . --ext .ts",
"prepare": "npm run lint && npm run build",
"test": "jest"
},
"husky": {
"hooks": {
"pre-commit": "npm run lint && npm run build"
}
},
"files": [
"index.js",
"index.d.ts",
"src/**/*.js",
"src/**/*.d.ts"
],
"dependencies": {
"@rdfjs/data-model": "^1.1.2",
"@types/jest": "^25.2.1",
Expand All @@ -20,11 +30,12 @@
"@typescript-eslint/eslint-plugin": "^2.33.0",
"@typescript-eslint/parser": "^2.33.0",
"eslint": "^7.0.0",
"eslint-config-es": "^3.19.61",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-tsdoc": "^0.2.4",
"husky": "^4.2.5",
"jest": "^26.0.1",
"pre-commit": "^1.2.2",
"prettier": "^2.0.5",
"ts-jest": "^25.5.1",
"typescript": "^3.9.2"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions test/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
env: {
jest: true
}
};
4 changes: 2 additions & 2 deletions test/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe('A basic test', () => {
it('to have something pass', () => {
describe('A basic test', (): void => {
it('to have something pass.', async (): Promise<void> => {
expect(true).toBeTruthy();
});
});
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
"noImplicitThis": true,
"noUnusedLocals": true,
"preserveConstEnums": true,
"sourceMap": true
"sourceMap": true,
"stripInternal": true
},
"include": [
"lib/**/*.ts",
"src/**/*.ts",
"test/**/*.ts"
],
"exclude": [
Expand Down

0 comments on commit f8e136c

Please sign in to comment.