Skip to content
This repository was archived by the owner on Dec 8, 2024. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.d.ts
45 changes: 24 additions & 21 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,16 @@ module.exports = {
ecmaVersion: 2017,
},
plugins: ['node', 'prettier'],
extends: [
'eslint:recommended',
'plugin:node/recommended',
'plugin:prettier/recommended',
],
extends: ['eslint:recommended', 'plugin:node/recommended', 'plugin:prettier/recommended'],
env: {
node: true,
},
ignorePatterns: ['dist/**/*.js'],
rules: { },
ignorePatterns: ['src/**/*.js', '__tests__/**/*.js'],
rules: {},
overrides: [
// test files
{
files: [
'__tests__/**/*.js',
],
files: ['__tests__/**/*.js'],
env: {
jest: true,
},
Expand All @@ -39,31 +33,40 @@ module.exports = {
'plugin:@typescript-eslint/recommended',
],
rules: {
'node/no-unsupported-features/es-syntax': ['error', {
'ignores': ['modules']
}],
'prefer-const': 'off',
'node/no-unsupported-features/es-syntax': [
'error',
{
ignores: ['modules'],
},
],
'node/no-missing-import': 'off',

'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/explicit-module-boundary-types': ['off'],

// We should try to remove this eventually
'@typescript-eslint/explicit-function-return-type': 'off',

'@typescript-eslint/ban-types': ['error', {
types: {
// we currently use `object` as "valid WeakMap key" in a lot of APIs
object: false,
}
}],
'@typescript-eslint/ban-types': [
'error',
{
types: {
// we currently use `object` as "valid WeakMap key" in a lot of APIs
object: false,
},
},
],

// disabling this one because of DEBUG APIs, if we ever find a better
// way to suport those we should re-enable it
'@typescript-eslint/no-non-null-assertion': 'off',

'@typescript-eslint/no-use-before-define': 'off',
}
},
},
],
};
64 changes: 32 additions & 32 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,57 +10,57 @@ on:

pull_request: {}
schedule:
- cron: '0 6 * * 0' # weekly, on sundays
- cron: '0 6 * * 0' # weekly, on sundays

jobs:
lint:
name: Linting
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12.x
- name: install yarn
run: npm install -g yarn
- name: install dependencies
run: yarn install
- name: linting
run: yarn lint
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12.x
- name: install yarn
run: npm install -g yarn
- name: install dependencies
run: yarn install
- name: linting
run: yarn lint

test:
name: Tests
runs-on: ubuntu-latest

strategy:
matrix:
node: ['10', '12', '14']
node: ['12', '14']

steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: install yarn
run: npm install -g yarn
- name: install dependencies
run: yarn install
- name: test
run: yarn test
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: install yarn
run: npm install -g yarn
- name: install dependencies
run: yarn install
- name: test
run: yarn test

floating-test:
name: Floating dependencies
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: install yarn
run: npm install -g yarn
- name: install dependencies
run: yarn install --no-lockfile
- name: test
run: yarn test
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: install yarn
run: npm install -g yarn
- name: install dependencies
run: yarn install --no-lockfile
- name: test
run: yarn test
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ node_modules
/.eslintcache
/dist
yarn-error.log
/src/**/*.d.ts
/src/**/*.js
/src/**/*.js.map
/__tests__/**/*.d.ts
/__tests__/**/*.js
/__tests__/**/*.js.map
22 changes: 22 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
// 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": [
{
"name": "Debug Jest Tests",
"type": "node",
"request": "launch",
"runtimeArgs": [
"--inspect-brk",
"${workspaceRoot}/node_modules/.bin/jest",
"--runInBand",
"--no-cache"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"port": 9229
}
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"editor.formatOnSave": true
}
5 changes: 0 additions & 5 deletions __tests__/mock-precompile.js

This file was deleted.

3 changes: 3 additions & 0 deletions __tests__/mock-precompile.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function precompile(value: string) {
return `precompiledFromPath(${value})`;
}
Loading