diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 0000000..4faa803 --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,10 @@ +module.exports = { + extends: ['./node_modules/@balena/lint/config/.eslintrc.js'], + parserOptions: { + project: 'tsconfig.js.json', + sourceType: 'module', + }, + env: { + mocha: true, + } +}; \ No newline at end of file diff --git a/.lintstagedrc b/.lintstagedrc index 242eef4..3b463ff 100644 --- a/.lintstagedrc +++ b/.lintstagedrc @@ -1,8 +1,8 @@ { "*.ts": [ - "balena-lint --typescript --fix" + "balena-lint --fix" ], "*.js": [ - "balena-lint --typescript --fix" - ], + "balena-lint --fix" + ] } diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..9cf9495 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +package-lock=false \ No newline at end of file diff --git a/odata-parser.d.ts b/odata-parser.d.ts index 7d3ffa1..8a1648d 100644 --- a/odata-parser.d.ts +++ b/odata-parser.d.ts @@ -27,7 +27,7 @@ interface GenericPropertyPath { name: string; property?: T; } -export interface PropertyPath extends GenericPropertyPath {} +export type PropertyPath = GenericPropertyPath; export interface OrderByPropertyPath extends GenericPropertyPath { order: 'asc' | 'desc'; diff --git a/package.json b/package.json index 6c957e6..1ffc6aa 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,6 @@ "pretest": "npm run prepare && npx tsc --noEmit odata-parser.d.ts", "test": "mocha", "posttest": "npm run lint", - "prepublish": "require-npm4-to-publish", "prepare": "node -e \"try { require('husky').install() } catch (e) {if (e.code !== 'MODULE_NOT_FOUND') throw e}\" && peggy --source-map --extra-options-file odata-parser.config.json --output odata-parser.js odata-parser.pegjs", "prettify": "balena-lint -e ts -e js --typescript --fix odata-parser.d.ts test" }, @@ -16,7 +15,7 @@ "author": "", "license": "BSD", "devDependencies": { - "@balena/lint": "^6.2.2", + "@balena/lint": "^7.2.4", "@types/chai": "^4.3.4", "@types/lodash": "^4.14.194", "@types/mocha": "^10.0.1", @@ -26,7 +25,6 @@ "lodash": "^4.17.21", "mocha": "^10.2.0", "peggy": "^3.0.2", - "require-npm4-to-publish": "^1.0.0", "ts-node": "^10.9.1", "typescript": "^5.0.4" }, diff --git a/test/expand.js b/test/expand.js index 56a46ea..44709f9 100644 --- a/test/expand.js +++ b/test/expand.js @@ -94,13 +94,15 @@ const testExpands = function (test, nested = 1) { const nestedExpandTest = testExpandOption.bind(null, test); nestedExpandTest.skip = testExpandOption.bind(null, test.skip); + // eslint-disable-next-line no-only-tests/no-only-tests nestedExpandTest.only = testExpandOption.bind(null, test.only); const nestedCountTest = testExpandOptionCount.bind(null, test); nestedCountTest.skip = testExpandOptionCount.bind(null, test.skip); + // eslint-disable-next-line no-only-tests/no-only-tests nestedCountTest.only = testExpandOptionCount.bind(null, test.only); - for (let nestedTest of [nestedExpandTest, nestedCountTest]) { + for (const nestedTest of [nestedExpandTest, nestedCountTest]) { filterby(nestedTest); format(nestedTest); orderby(nestedTest); diff --git a/test/orderby.js b/test/orderby.js index 7dd6d1d..79b654a 100644 --- a/test/orderby.js +++ b/test/orderby.js @@ -130,6 +130,7 @@ export default (test) => { const nestedFilterTest = testFilterOption.bind(null, test); nestedFilterTest.skip = testFilterOption.bind(null, test.skip); + // eslint-disable-next-line no-only-tests/no-only-tests nestedFilterTest.only = testFilterOption.bind(null, test.only); filterby(nestedFilterTest); diff --git a/test/test.js b/test/test.js index db07087..d6261db 100644 --- a/test/test.js +++ b/test/test.js @@ -43,10 +43,12 @@ const runExpectation = function (...args) { const test = runExpectation.bind(null, describe); test.skip = runExpectation.bind(null, describe.skip); +// eslint-disable-next-line no-only-tests/no-only-tests test.only = runExpectation.bind(null, describe.only); test.raw = raw.bind(null, describe); test.raw.skip = raw.bind(null, describe.skip); +// eslint-disable-next-line no-only-tests/no-only-tests test.raw.only = raw.bind(null, describe.only); export default test;