-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sync eslint config with base comunica
- Loading branch information
1 parent
d3e8018
commit 588e946
Showing
20 changed files
with
1,885 additions
and
427 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
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,13 +1,14 @@ | ||
import { QueryEngineBase } from '@comunica/actor-init-query'; | ||
import type { ActorInitQueryBase } from '@comunica/actor-init-query'; | ||
|
||
// eslint-disable-next-line ts/no-require-imports,ts/no-var-requires,import/extensions | ||
const engineDefault = require('../engine-default.js'); | ||
|
||
/** | ||
* A Comunica SPARQL query engine. | ||
*/ | ||
export class QueryEngine extends QueryEngineBase { | ||
public constructor(engine: ActorInitQueryBase = engineDefault) { | ||
public constructor(engine: ActorInitQueryBase = engineDefault()) { | ||
super(engine); | ||
} | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,95 @@ | ||
const config = require('@rubensworks/eslint-config'); | ||
|
||
module.exports = config([ | ||
{ | ||
files: [ '**/*.ts' ], | ||
languageOptions: { | ||
parserOptions: { | ||
tsconfigRootDir: __dirname, | ||
project: [ './tsconfig.eslint.json' ], | ||
}, | ||
}, | ||
}, | ||
{ | ||
rules: { | ||
// Default | ||
'unicorn/consistent-destructuring': 'off', | ||
'unicorn/no-array-callback-reference': 'off', | ||
|
||
// TODO: check if these can be enabled | ||
'ts/naming-convention': 'off', | ||
'ts/no-unsafe-return': 'off', | ||
'ts/no-unsafe-argument': 'off', | ||
'ts/no-unsafe-assignment': 'off', | ||
|
||
'ts/no-require-imports': [ 'error', { allow: [ | ||
'process/', | ||
'web-streams-ponyfill', | ||
'is-stream', | ||
'readable-stream-node-to-web', | ||
'stream-to-string', | ||
]}], | ||
'ts/no-var-requires': [ 'error', { allow: [ | ||
'process/', | ||
'web-streams-ponyfill', | ||
'is-stream', | ||
'readable-stream-node-to-web', | ||
'stream-to-string', | ||
]}], | ||
}, | ||
}, | ||
{ | ||
// Specific rules for NodeJS-specific files | ||
files: [ | ||
'**/test/**/*.ts', | ||
], | ||
rules: { | ||
'import/no-nodejs-modules': 'off', | ||
'unused-imports/no-unused-vars': 'off', | ||
'ts/no-require-imports': 'off', | ||
'ts/no-var-requires': 'off', | ||
}, | ||
}, | ||
{ | ||
// The config packages use an empty index.ts | ||
files: [ | ||
'engines/config-*/lib/index.ts', | ||
], | ||
rules: { | ||
'import/unambiguous': 'off', | ||
}, | ||
}, | ||
{ | ||
// Some test files import 'jest-rdf' which triggers this | ||
// The http actors import 'cross-fetch/polyfill' which also triggers this | ||
// Some jest tests import '../../lib' which triggers this | ||
files: [ | ||
'**/test/*-test.ts', | ||
'**/test/*-util.ts', | ||
], | ||
rules: { | ||
'import/no-unassigned-import': 'off', | ||
}, | ||
}, | ||
{ | ||
// Files that do not require linting | ||
ignores: [ | ||
'setup-jest.js', | ||
'**/engine-default.js', | ||
'**/engine-browser.js', | ||
'**/comunica-browser.js', | ||
'.github/**', | ||
'**/bintest/**', | ||
], | ||
}, | ||
{ | ||
files: [ '**/*.js' ], | ||
rules: { | ||
'ts/no-require-imports': 'off', | ||
'ts/no-var-requires': 'off', | ||
'import/no-nodejs-modules': 'off', | ||
'import/no-extraneous-dependencies': 'off', | ||
'import/extensions': 'off', | ||
}, | ||
}, | ||
]); |
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,31 +1,31 @@ | ||
module.exports = { | ||
transform: { | ||
'^.+\\.ts$': 'ts-jest' | ||
'^.+\\.ts$': 'ts-jest', | ||
}, | ||
testRegex: '/test/.*-test.ts$', | ||
moduleFileExtensions: [ | ||
'ts', | ||
'js' | ||
'js', | ||
], | ||
globals: { | ||
'ts-jest': { | ||
isolatedModules: true | ||
isolatedModules: true, | ||
}, | ||
}, | ||
setupFilesAfterEnv: [ './setup-jest.js' ], | ||
collectCoverage: true, | ||
coveragePathIgnorePatterns: [ | ||
'/node_modules/', | ||
'/mocks/', | ||
'index.js' | ||
'index.js', | ||
], | ||
testEnvironment: 'node', | ||
coverageThreshold: { | ||
global: { | ||
branches: 100, | ||
functions: 100, | ||
lines: 100, | ||
statements: 100 | ||
} | ||
} | ||
statements: 100, | ||
}, | ||
}, | ||
}; |
Oops, something went wrong.