Skip to content

Commit

Permalink
Merge branch 'main' into eslint-comments/require-description
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante committed Mar 2, 2023
2 parents 897803e + fe6db72 commit 6351367
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 10 deletions.
31 changes: 27 additions & 4 deletions config/plugins.cjs
Expand Up @@ -222,17 +222,34 @@ module.exports = {
},
],
'import/no-useless-path-segments': 'error',
'import/newline-after-import': 'error',
'import/newline-after-import': [
'error',
{
// TODO: Buggy.
// considerComments: true,
},
],
'import/no-amd': 'error',
'import/no-duplicates': 'error',
'import/no-duplicates': [
'error',
{
'prefer-inline': true,
},
],

// We use `unicorn/prefer-module` instead.
// 'import/no-commonjs': 'error',

// Looks useful, but too unstable at the moment
// 'import/no-deprecated': 'error',

'import/no-extraneous-dependencies': 'error',
'import/no-empty-named-blocks': 'error',
'import/no-extraneous-dependencies': [
'error',
{
includeTypes: true,
},
],
'import/no-mutable-exports': 'error',
'import/no-named-as-default-member': 'error',
'import/no-named-as-default': 'error',
Expand All @@ -245,7 +262,13 @@ module.exports = {
// }
// ],

'import/order': 'error',
'import/order': [
'error',
{
'newlines-between': 'never',
warnOnUnassignedImports: true,
},
],
'import/no-unassigned-import': [
'error',
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -72,7 +72,7 @@
"eslint-import-resolver-webpack": "^0.13.2",
"eslint-plugin-ava": "^13.2.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^15.5.1",
"eslint-plugin-no-use-extend-native": "^0.5.0",
"eslint-plugin-prettier": "^4.2.1",
Expand Down
5 changes: 5 additions & 0 deletions test/fixtures/typescript/child/sub-child/tsconfig.json
@@ -0,0 +1,5 @@
{
"compilerOptions": {
"strictNullChecks": true
}
}
3 changes: 3 additions & 0 deletions test/fixtures/typescript/child/tsconfig.json
@@ -1,4 +1,7 @@
{
"compilerOptions": {
"strictNullChecks": true
},
"include": [
"**/*.ts",
"**/*.tsx"
Expand Down
10 changes: 6 additions & 4 deletions test/lint-files.js
Expand Up @@ -233,13 +233,15 @@ test.serial('typescript 2 space option', async t => {
});

test.serial('typescript 4 space option', async t => {
const {errorCount} = await xo.lintFiles('child/sub-child/four-spaces.ts', {cwd: 'fixtures/typescript', space: 4});
t.is(errorCount, 0);
const {errorCount, results} = await xo.lintFiles('child/sub-child/four-spaces.ts', {cwd: 'fixtures/typescript', space: 4});
// eslint-disable-next-line ava/assertion-arguments
t.is(errorCount, 0, JSON.stringify(results[0].messages));
});

test.serial('typescript no semicolon option', async t => {
const {errorCount} = await xo.lintFiles('child/no-semicolon.ts', {cwd: 'fixtures/typescript', semicolon: false});
t.is(errorCount, 0);
const {errorCount, results} = await xo.lintFiles('child/no-semicolon.ts', {cwd: 'fixtures/typescript', semicolon: false});
// eslint-disable-next-line ava/assertion-arguments
t.is(errorCount, 0, JSON.stringify(results[0].messages));
});

test('webpack import resolver is used if webpack.config.js is found', async t => {
Expand Down
3 changes: 2 additions & 1 deletion test/lint-text.js
Expand Up @@ -346,7 +346,8 @@ test('typescript files: four space pass', async t => {
filePath: fourSpacesFilePath,
space: 4,
});
t.is(results[0].errorCount, 0);
// eslint-disable-next-line ava/assertion-arguments
t.is(results[0].errorCount, 0, JSON.stringify(results[0].messages));
});

test('deprecated rules', async t => {
Expand Down

0 comments on commit 6351367

Please sign in to comment.