Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable eslint-plugin-promise #656

Merged
merged 3 commits into from
Jul 13, 2024
Merged
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
26 changes: 12 additions & 14 deletions config/plugins.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ module.exports = {
'no-use-extend-native',
'ava',
'unicorn',
// Disabled as the plugin doesn't support ESLint 8 yet.
// 'promise',
'promise',
'import',
'n', // eslint-plugin-node's successor
'eslint-comments',
Expand Down Expand Up @@ -184,18 +183,17 @@ module.exports = {
// TODO: Temporarily disabled as the rule is buggy.
'function-call-argument-newline': 'off',

// Disabled as the plugin doesn't support ESLint 8 yet.
// 'promise/param-names': 'error',
// 'promise/no-return-wrap': [
// 'error',
// {
// allowReject: true,
// },
// ],
// 'promise/no-new-statics': 'error',
// 'promise/no-return-in-finally': 'error',
// 'promise/valid-params': 'error',
// 'promise/prefer-await-to-then': 'error',
'promise/param-names': 'error',
'promise/no-return-wrap': [
'error',
{
allowReject: true,
},
],
'promise/no-new-statics': 'error',
'promise/no-return-in-finally': 'error',
'promise/valid-params': 'error',
'promise/prefer-await-to-then': 'error',

'import/default': 'error',
'import/export': 'error',
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-no-use-extend-native": "^0.5.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-promise": "^6.4.0",
"eslint-plugin-unicorn": "^51.0.1",
"esm-utils": "^4.2.1",
"find-cache-dir": "^5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion test/lint-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ test('multiple negative patterns should act as positive patterns', async t => {
t.deepEqual(paths, ['!!unicorn.js', '!unicorn.js']);
});

test.failing('enable rules based on nodeVersion', async t => {
test('enable rules based on nodeVersion', async t => {
const {results, rulesMeta} = await xo.lintFiles('**/*', {cwd: 'fixtures/engines-overrides'});

// The transpiled file (as specified in `overrides`) should use `await`
Expand Down
4 changes: 2 additions & 2 deletions test/lint-text.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ test('lint eslintignored files if filename is not given', async t => {
t.true(results[0].errorCount > 0);
});

test.failing('enable rules based on nodeVersion', async t => {
test('enable rules based on nodeVersion', async t => {
const cwd = path.join(__dirname, 'fixtures', 'engines-overrides');
const filePath = path.join(cwd, 'promise-then.js');
const text = await fs.readFile(filePath, 'utf8');
Expand All @@ -221,7 +221,7 @@ test.failing('enable rules based on nodeVersion', async t => {
t.false(hasRule(results, 'promise/prefer-await-to-then', rulesMeta));
});

test.failing('enable rules based on nodeVersion in override', async t => {
test('enable rules based on nodeVersion in override', async t => {
const cwd = path.join(__dirname, 'fixtures', 'engines-overrides');
const filePath = path.join(cwd, 'promise-then.js');
const text = await fs.readFile(filePath, 'utf8');
Expand Down