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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 12 additions & 14 deletions config/plugins.cjs
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',
'node',
'eslint-comments',
Expand Down Expand Up @@ -174,18 +173,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
Expand Up @@ -76,6 +76,7 @@
"eslint-plugin-no-use-extend-native": "^0.5.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-unicorn": "^40.1.0",
"esm-utils": "^2.0.1",
"find-cache-dir": "^3.3.2",
Expand Down
2 changes: 1 addition & 1 deletion test/lint-files.js
Expand Up @@ -119,7 +119,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} = 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
Expand Up @@ -205,7 +205,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 @@ -217,7 +217,7 @@ test.failing('enable rules based on nodeVersion', async t => {
t.false(hasRule(results, 'promise/prefer-await-to-then'));
});

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