-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Bruno Besson
committed
Apr 11, 2023
1 parent
2c6dd37
commit be8681a
Showing
9 changed files
with
135 additions
and
73 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,71 @@ | ||
module.exports = { | ||
root: true, | ||
extends: ['eslint:recommended'], | ||
env: { | ||
node: true, | ||
es2022: true, | ||
}, | ||
parser: '@typescript-eslint/parser', // Specifies the ESLint parser | ||
extends: [ | ||
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin | ||
'plugin:@typescript-eslint/recommended-requiring-type-checking', | ||
'prettier', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier | ||
'plugin:node/recommended', | ||
'plugin:security/recommended', | ||
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array. | ||
], | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
project: './tsconfig.eslint.json', | ||
sourceType: 'module', // Allows for the use of imports, | ||
}, | ||
rules: { | ||
'node/no-extraneous-import': ['error', { allowModules: ['pino'] }], | ||
'node/no-missing-import': 'off', | ||
'node/no-unpublished-import': ['error', { allowModules: ['type-fest'] }], | ||
'node/no-unsupported-features/es-syntax': 'off', | ||
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true, destructuredArrayIgnorePattern: '^_' }], | ||
'@typescript-eslint/camelcase': 'off', | ||
'@typescript-eslint/explicit-function-return-type': 'error', | ||
'@typescript-eslint/explicit-member-accessibility': ['error', { overrides: { constructors: 'no-public' } }], | ||
sourceType: 'module', | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['./**/*.ts]'], | ||
rules: { | ||
'@typescript-eslint/no-throw-literal': 'error', | ||
files: ['./**/*.ts'], | ||
parser: '@typescript-eslint/parser', // Specifies the ESLint parser | ||
extends: [ | ||
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin | ||
'plugin:@typescript-eslint/recommended-requiring-type-checking', | ||
'prettier', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier | ||
'plugin:node/recommended', | ||
'plugin:security/recommended', | ||
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array. | ||
], | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
project: './tsconfig.eslint.json', | ||
sourceType: 'module', // Allows for the use of imports, | ||
}, | ||
}, | ||
{ | ||
files: ['test/**/*.ts'], | ||
plugins: ['jest'], | ||
extends: ['plugin:jest/recommended'], | ||
rules: { | ||
'node/no-unpublished-import': 'off', | ||
'node/no-extraneous-import': 'off', | ||
'@typescript-eslint/unbound-method': 'off', | ||
'jest/unbound-method': 'error', | ||
'node/no-extraneous-import': ['error', { allowModules: ['pino'] }], | ||
'node/no-missing-import': 'off', | ||
'node/no-unpublished-import': ['error', { allowModules: ['type-fest'] }], | ||
'node/no-unsupported-features/es-syntax': 'off', | ||
'@typescript-eslint/no-unused-vars': [ | ||
'error', | ||
{ ignoreRestSiblings: true, destructuredArrayIgnorePattern: '^_' }, | ||
], | ||
'@typescript-eslint/camelcase': 'off', | ||
'@typescript-eslint/explicit-function-return-type': 'error', | ||
'@typescript-eslint/explicit-member-accessibility': ['error', { overrides: { constructors: 'no-public' } }], | ||
}, | ||
}, | ||
], | ||
settings: { | ||
'import/resolvers': { | ||
typescript: { | ||
alwaysTryTypes: true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist` | ||
project: '.', | ||
overrides: [ | ||
{ | ||
files: ['./**/*.ts]'], | ||
rules: { | ||
'@typescript-eslint/no-throw-literal': 'error', | ||
}, | ||
}, | ||
{ | ||
files: ['test/**/*.ts'], | ||
plugins: ['jest'], | ||
extends: ['plugin:jest/recommended'], | ||
rules: { | ||
'node/no-unpublished-import': 'off', | ||
'node/no-extraneous-import': 'off', | ||
'@typescript-eslint/unbound-method': 'off', | ||
'jest/unbound-method': 'error', | ||
}, | ||
}, | ||
], | ||
settings: { | ||
'import/resolvers': { | ||
typescript: { | ||
alwaysTryTypes: true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist` | ||
project: '.', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
], | ||
}; |
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
14 changes: 10 additions & 4 deletions
14
...ations/20221104000000_activity_details.ts → ...tions/20221104000000_activity_details.mjs
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
14 changes: 10 additions & 4 deletions
14
...ns/20221122000000_polar_webhook_secret.ts → ...s/20221122000000_polar_webhook_secret.mjs
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,14 +1,20 @@ | ||
import type { Knex } from 'knex'; | ||
|
||
const schema = process.env['DB_SCHEMA'] || 'public'; | ||
|
||
export function up(db: Knex): Knex.SchemaBuilder { | ||
/** | ||
* @param {import('knex').Knex} db | ||
* @returns {import('knex').Knex.SchemaBuilder} | ||
*/ | ||
export function up(db) { | ||
return db.schema.withSchema(schema).alterTable('polar', (table) => { | ||
table.string('webhook_secret', 256).alter({ alterNullable: false, alterType: true }); | ||
}); | ||
} | ||
|
||
export function down(db: Knex): Knex.SchemaBuilder { | ||
/** | ||
* @param {import('knex').Knex} db | ||
* @returns {import('knex').Knex.SchemaBuilder} | ||
*/ | ||
export function down(db) { | ||
// nothing to do | ||
return db.schema.withSchema(schema); | ||
} |
14 changes: 10 additions & 4 deletions
14
...b/migrations/20230127000000_miniatures.ts → .../migrations/20230127000000_miniatures.mjs
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