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

fix(theme): add file extension to Theme imports and respective eslint rule #4771

Merged
merged 2 commits into from
Sep 19, 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
13 changes: 11 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"root": true,
"plugins": ["notice", "@spectrum-web-components", "import"],
"plugins": [
"notice",
"@spectrum-web-components",
"import",
"require-extensions"
],
"env": {
"browser": true,
"node": true,
Expand Down Expand Up @@ -64,7 +69,11 @@
}
]
},
"extends": ["plugin:prettier/recommended", "plugin:lit-a11y/recommended"],
"extends": [
"plugin:prettier/recommended",
"plugin:lit-a11y/recommended",
"plugin:require-extensions/recommended"
],
"overrides": [
{
"files": ["tasks/*", "scripts/*"],
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
"eslint-plugin-lit-a11y": "^2.2.2",
"eslint-plugin-notice": "^0.9.10",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-require-extensions": "^0.1.3",
"eslint-plugin-storybook": "^0.8.0",
"express": "^4.16.4",
"fast-glob": "^3.2.12",
Expand Down
17 changes: 14 additions & 3 deletions tools/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,26 @@
"es6": true
},
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "notice", "@spectrum-web-components"],
"plugins": [
"@typescript-eslint",
"notice",
"@spectrum-web-components",
"require-extensions"
],
"extends": [
"plugin:@typescript-eslint/recommended",
"prettier",
"plugin:lit-a11y/recommended"
"plugin:lit-a11y/recommended",
"plugin:require-extensions/recommended"
],
"rules": {
"no-debugger": 2,
"no-console": ["error", { "allow": ["warn", "error"] }],
"no-console": [
"error",
{
"allow": ["warn", "error"]
}
],
"@spectrum-web-components/prevent-argument-names": [
"error",
["e", "ev", "evt", "err"]
Expand Down
2 changes: 1 addition & 1 deletion tools/theme/src/Theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
SystemVariant,
ThemeFragmentMap,
ThemeKindProvider,
} from './theme-interfaces';
} from './theme-interfaces.js';
export type { ProvideLang, ThemeFragmentMap, Color, Scale, SystemVariant };
/**
* @element sp-theme
Expand Down
2 changes: 1 addition & 1 deletion tools/theme/test/theme-devmode.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import '@spectrum-web-components/theme/sp-theme.js';
import { Theme } from '@spectrum-web-components/theme';
import { elementUpdated, expect, fixture, html } from '@open-wc/testing';
import { stub } from 'sinon';
import { testForLitDevWarnings } from '../../../test/testing-helpers';
import { testForLitDevWarnings } from '../../../test/testing-helpers.js';

describe('Theme', () => {
testForLitDevWarnings(
Expand Down
7 changes: 6 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5349,7 +5349,7 @@
integrity sha512-rGfd7jqXOdR69bEjrRP58ynuIeJU0czPfwQvzhtCzg7jKVukV+efNHqrs086sC6xutB3W4TF71K/dZMr3oyTyg==

"@spectrum-web-components/eslint-plugin@file:./linters/eslint":
version "0.47.2"
version "0.48.0"

"@storybook/addon-a11y@^7.5.0":
version "7.6.19"
Expand Down Expand Up @@ -12063,6 +12063,11 @@ eslint-plugin-prettier@^5.1.3:
prettier-linter-helpers "^1.0.0"
synckit "^0.8.6"

eslint-plugin-require-extensions@^0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/eslint-plugin-require-extensions/-/eslint-plugin-require-extensions-0.1.3.tgz#394aeab433f996797a6ceba0a3f75640d4846bc8"
integrity sha512-T3c1PZ9PIdI3hjV8LdunfYI8gj017UQjzAnCrxuo3wAjneDbTPHdE3oNWInOjMA+z/aBkUtlW5vC0YepYMZIug==

eslint-plugin-storybook@^0.8.0:
version "0.8.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-storybook/-/eslint-plugin-storybook-0.8.0.tgz#23185ecabdc289cae55248c090f0c1d8fbae6c41"
Expand Down
Loading