Skip to content

Commit

Permalink
refactor(mower-command): add tests for command button containers [IMO…
Browse files Browse the repository at this point in the history
…WAPP-3277]
  • Loading branch information
Lukas Kullmann committed Apr 19, 2022
1 parent 995c12c commit 040657c
Show file tree
Hide file tree
Showing 12 changed files with 88 additions and 5 deletions.
9 changes: 9 additions & 0 deletions .idea/eslint-plugin-import.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
### Changed
- [Tests] `named`: Run all TypeScript test ([#2427], thanks [@ProdigySim])

### Fixed
- [`no-unresolved`, `extensions`]: ignore type only exports ([#2436], thanks [@Lukas-Kullmann])

## [2.26.0] - 2022-04-05

### Added
Expand Down
9 changes: 9 additions & 0 deletions eslint-plugin-import.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
6 changes: 3 additions & 3 deletions src/rules/extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ module.exports = {
function checkFileExtension(source, node) {
// bail if the declaration doesn't have a source, e.g. "export { foo };", or if it's only partially typed like in an editor
if (!source || !source.value) return;

const importPathWithQueryString = source.value;

// don't enforce anything on builtins
Expand All @@ -164,8 +164,8 @@ module.exports = {
) || isScoped(importPath);

if (!extension || !importPath.endsWith(`.${extension}`)) {
// ignore type-only imports
if (node.importKind === 'type') return;
// ignore type-only imports and exports
if (node.importKind === 'type' || node.exportKind === 'type') return;
const extensionRequired = isUseOfExtensionRequired(extension, isPackage);
const extensionForbidden = isUseOfExtensionForbidden(extension);
if (extensionRequired && !extensionForbidden) {
Expand Down
4 changes: 2 additions & 2 deletions src/rules/no-unresolved.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ module.exports = {
const options = context.options[0] || {};

function checkSourceValue(source, node) {
// ignore type-only imports
if (node.importKind === 'type') {
// ignore type-only imports and exports
if (node.importKind === 'type' || node.exportKind === 'type') {
return;
}

Expand Down
17 changes: 17 additions & 0 deletions tests/src/rules/extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,14 @@ describe('TypeScript', () => {
],
parser,
}),
test({
code: 'export type T from "./typescript-declare";',
options: [
'always',
{ ts: 'never', tsx: 'never', js: 'never', jsx: 'never' },
],
parser,
}),
],
invalid: [
test({
Expand All @@ -624,6 +632,15 @@ describe('TypeScript', () => {
],
parser,
}),
test({
code: 'export T from "./typescript-declare";',
errors: ['Missing file extension for "./typescript-declare"'],
options: [
'always',
{ ts: 'never', tsx: 'never', js: 'never', jsx: 'never' },
],
parser,
}),
],
});
});
Expand Down
9 changes: 9 additions & 0 deletions tests/src/rules/no-unresolved.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,13 +451,22 @@ context('TypeScript', () => {
code: 'import type { JSONSchema7Type } from "@types/json-schema";',
parser,
}),
test({
code: 'export type { JSONSchema7Type } from "@types/json-schema";',
parser,
}),
],
invalid: [
test({
code: 'import { JSONSchema7Type } from "@types/json-schema";',
errors: [ "Unable to resolve path to module '@types/json-schema'." ],
parser,
}),
test({
code: 'export { JSONSchema7Type } from "@types/json-schema";',
errors: [ "Unable to resolve path to module '@types/json-schema'." ],
parser,
}),
],
});
});
Expand Down

0 comments on commit 040657c

Please sign in to comment.