Skip to content

Commit

Permalink
Re-enable eslint-plugin-promise (#656)
Browse files Browse the repository at this point in the history
Co-authored-by: Federico Brigante <me@fregante.com>
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
  • Loading branch information
3 people authored Jul 13, 2024
1 parent ee9f0a3 commit b168f08
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 17 deletions.
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

0 comments on commit b168f08

Please sign in to comment.