BUG: "Could not read results" on large result file?
See original GitHub issueI have the following .betterer.ts
:
import { typescript } from '@betterer/typescript';
import { eslint } from '@betterer/eslint';
export default {
'stricter typescript': typescript('./tsconfig.json', {
strict: true,
}),
'stricter eslint': eslint({
'@typescript-eslint/ban-ts-comment': 'error',
'@typescript-eslint/ban-types': 'error',
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'error',
'@typescript-eslint/no-empty-function': 'error',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-inferrable-types': 'error',
'@typescript-eslint/no-redeclare': 'error',
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'@typescript-eslint/no-unsafe-assignment': 'error',
'@typescript-eslint/no-unsafe-call': 'error',
'@typescript-eslint/no-unsafe-member-access': 'error',
'@typescript-eslint/no-unsafe-return': 'error',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-var-requires': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/restrict-plus-operands': 'error',
'@typescript-eslint/restrict-template-expressions': 'error',
'@typescript-eslint/strict-boolean-expressions': 'error',
'@typescript-eslint/switch-exhaustiveness-check': 'error',
'@typescript-eslint/unbound-method': 'error',
'import/no-anonymous-default-export': 'error',
'jsx-a11y/alt-text': 'error',
'jsx-a11y/anchor-is-valid': 'error',
'jsx-a11y/click-events-have-key-events': 'error',
'jsx-a11y/label-has-associated-control': 'error',
'jsx-a11y/no-autofocus': 'error',
'jsx-a11y/no-noninteractive-element-interactions': 'error',
'jsx-a11y/no-onchange': 'error',
'jsx-a11y/no-static-element-interactions': 'error',
'no-use-before-define': 'error',
'react-hooks/exhaustive-deps': 'error',
'react/jsx-no-target-blank': 'error',
'react/prop-types': 'error',
})
.include('./Content/Scripts/**/*.{ts,tsx,js,jsx}'),
};
Running npx betterer
the first time works fine, and the .betterer.results
is generated. However, when I try to run it again, I get the following error:
\ | / _ _ _
'-.ooo.-' | |__ ___| |_| |_ ___ _ __ ___ _ __
---ooooo--- | '_ \ / _ \ __| __/ _ \ '__/ _ \ '__|
.-'ooo'-. | |_) | __/ |_| || __/ | | __/ |
/ | \ |_.__/ \___|\__|\__\___|_| \___|_|
☀️ betterer erro 🔥 - could not read results from "C:\dev\projects\portal\OPF.Portal.Web\.betterer.results". 😔
- If I delete
.betterer.results
, and.skip()
thestricter eslint
test, then it runs fine both times. - If I delete
.betterer.results
, and.skip()
thestricter typescript
test, then I get the same error.
In other words, the stricter eslint
test caused the second run to fail, regardless of the stricter typescript
being part of it or not.
Adding @betterer/eslint
did make the .betterer.results
file grow from ~2k lines to ~15k lines. So from from what I can gather, this must probably have something to do with how you’re trying to read that file? Is it running into some sort of size/buffer issue or something? Not sure why the file size should be an issue, but the way that file is read here does seem a bit… special… 🤔
I guess it could also be related to the format of the output from @betterer/eslint
vs @betterer/typescript
, but as far as I can see, those look pretty much identical, so… 🤷♂️
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Should be fixed in 3.1.2!
Looks like you’ve found a pathological case for my file printing! I don’t just read the file as text, but I actually
require
it, so this issue here causes everything to break:Should be an easy fix, I’ll have a crack now.