Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ff3cb16
Change `Global` component to use the `StyleSheet` constructor of the …
Jack-Works Mar 10, 2022
7f8910a
Removed the direct dependency on from as it's no longer used that way
Andarist Mar 10, 2022
239f2d0
Version Packages (#2679)
github-actions[bot] Mar 10, 2022
2d3d7dd
Fixed `CacheProvider` demo in the docs (#2678)
pengx17 Mar 10, 2022
1a25293
Added `includeStyles` option to `createSerializer` to optionally disa…
thompsongl Apr 5, 2022
d935762
Fixed a false positive warning for `content` properties that included…
arturmuller Apr 5, 2022
8c1c7c7
Fixed a Prettier error
Andarist Apr 5, 2022
fc52bed
Update snapshots after renaming a test (#2711)
Andarist Apr 6, 2022
7a478fc
Version Packages (#2710)
github-actions[bot] Apr 6, 2022
3743483
Fixed an issue with `createEnzymeSerializer` not handling the recentl…
thompsongl Apr 7, 2022
6c9dbe5
Version Packages (#2716)
github-actions[bot] Apr 7, 2022
cd535bf
Update to new DocSearch index (#2718)
emmatown Apr 9, 2022
ae0f650
Fixed an issue in the minifying logic that could remove rules with th…
Andarist Apr 10, 2022
888377a
Version Packages (#2722)
github-actions[bot] Apr 10, 2022
409b237
Replace CodeSandbox link in bug report issue template (#2726)
srmagura Apr 16, 2022
6c652d9
Fix TS 4.7 error related to isPropValid
srmagura Apr 24, 2022
b575ef7
Merge branch 'main' of https://github.com/emotion-js/emotion into ts-…
srmagura Apr 24, 2022
69b3e06
Merge branch 'ts-april-23' into ts-merge
srmagura Apr 24, 2022
6bf9be3
Remove accidentally-committed .d.ts files
srmagura Apr 24, 2022
b9640a5
Fix unintentional breaking change to @emotion/memoize
srmagura Apr 24, 2022
f187b1d
Reorder function overloads in packages/memoize/src/index.ts
srmagura Apr 24, 2022
ba5f146
Make snapshots more readable (#2733)
SimenB Apr 25, 2022
7a3f608
Merge branch 'main' of https://github.com/emotion-js/emotion into ts-…
srmagura Apr 28, 2022
bf0a262
Merge pull request #2734 from emotion-js/preconstruct-upgrade
Andarist Apr 28, 2022
6c2d7a6
Allow any `Node` as container (#2728)
Peeja Apr 28, 2022
26e4e3e
Update "no component selectors" error message (#2727)
srmagura Apr 28, 2022
30f5cc4
Merge branch 'main' of https://github.com/emotion-js/emotion into ts-…
srmagura Apr 30, 2022
a485db3
styled: require prop to be a string
srmagura Apr 30, 2022
b45662d
Put in hacks to make .d.ts generation succeed for @emotion/eslint-plugin
srmagura Apr 30, 2022
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
Prev Previous commit
Put in hacks to make .d.ts generation succeed for @emotion/eslint-plugin
  • Loading branch information
srmagura committed Apr 30, 2022
commit b45662d92ca37a90d7feeebea154a4beaa605dfa
2 changes: 1 addition & 1 deletion packages/eslint-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import styledImport from './rules/styled-import'
import jsxImport from './rules/jsx-import'
import pkgRenaming from './rules/pkg-renaming'

export let rules = {
export const rules = {
'import-from-emotion': importFromEmotion,
'no-vanilla': noVanilla,
'syntax-preference': syntaxPreference,
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-plugin/src/rules/import-from-emotion.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/experimental-utils'
import { createRule } from '../utils'
import { createRule, EmotionESLintRule } from '../utils'

export default createRule({
name: __filename,
Expand Down Expand Up @@ -65,4 +65,4 @@ export default createRule({
}
}
}
})
}) as EmotionESLintRule
4 changes: 2 additions & 2 deletions packages/eslint-plugin/src/rules/jsx-import.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/experimental-utils'
import { createRule, REPO_URL } from '../utils'
import { createRule, EmotionESLintRule, REPO_URL } from '../utils'

const JSX_ANNOTATION_REGEX = /\*?\s*@jsx\s+([^\s]+)/
const JSX_IMPORT_SOURCE_REGEX = /\*?\s*@jsxImportSource\s+([^\s]+)/
Expand Down Expand Up @@ -273,4 +273,4 @@ export default createRule<RuleOptions, keyof typeof messages>({
}
}
}
})
}) as EmotionESLintRule
4 changes: 2 additions & 2 deletions packages/eslint-plugin/src/rules/no-vanilla.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createRule } from '../utils'
import { createRule, EmotionESLintRule } from '../utils'

export default createRule({
name: __filename,
Expand Down Expand Up @@ -27,4 +27,4 @@ export default createRule({
}
}
}
})
}) as EmotionESLintRule
4 changes: 2 additions & 2 deletions packages/eslint-plugin/src/rules/pkg-renaming.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils'
import { createRule } from '../utils'
import { createRule, EmotionESLintRule } from '../utils'

const simpleMappings = new Map<unknown, string>([
['@emotion/core', '@emotion/react'],
Expand Down Expand Up @@ -85,4 +85,4 @@ export default createRule({
}
}
}
})
}) as EmotionESLintRule
4 changes: 2 additions & 2 deletions packages/eslint-plugin/src/rules/styled-import.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils'
import { createRule } from '../utils'
import { createRule, EmotionESLintRule } from '../utils'

export default createRule({
name: __filename,
Expand Down Expand Up @@ -37,4 +37,4 @@ export default createRule({
}
}
}
})
}) as EmotionESLintRule
4 changes: 2 additions & 2 deletions packages/eslint-plugin/src/rules/syntax-preference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
TSESLint,
TSESTree
} from '@typescript-eslint/experimental-utils'
import { createRule } from '../utils'
import { createRule, EmotionESLintRule } from '../utils'

/**
* @fileoverview Choose between string or object syntax
Expand Down Expand Up @@ -265,4 +265,4 @@ export default createRule<RuleOptions, MessageId>({
return {}
}
}
})
}) as EmotionESLintRule
15 changes: 15 additions & 0 deletions packages/eslint-plugin/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,18 @@ export const createRule = ESLintUtils.RuleCreator(name => {

return `${REPO_URL}/blob/@emotion/eslint-plugin@${version}/packages/eslint-plugin/docs/rules/${ruleName}.md`
})

// This is based off of RuleModule from `@typescript-eslint/experimental-utils`.
// All exported rules should use this type to prevent the error:
//
// TS2742: The inferred type of 'rules' cannot be named without a reference to
// '@typescript-eslint/experimental-utils/node_modules/@typescript-eslint/types/dist/ast-spec'.
// This is likely not portable. A type annotation is necessary.
//
// Really, there is no need to generate TypeScript declarations for this
// package, but there does not seem to be a way to disable declaration
// generation when using Preconstruct
export interface EmotionESLintRule {
meta: unknown
create(context: unknown): unknown
}
4 changes: 2 additions & 2 deletions packages/eslint-plugin/test/rules/import-from-emotion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import { TSESLint } from '@typescript-eslint/experimental-utils'
import rule from '../../src/rules/import-from-emotion'
import { espreeParser } from '../test-utils'
import { RuleModuleForTesting, espreeParser } from '../test-utils'

const ruleTester = new TSESLint.RuleTester({
parser: espreeParser,
Expand All @@ -17,7 +17,7 @@ const ruleTester = new TSESLint.RuleTester({
}
})

ruleTester.run('emotion jsx', rule, {
ruleTester.run('emotion jsx', rule as unknown as RuleModuleForTesting, {
valid: [
{
code: `import { css } from 'emotion'`
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-plugin/test/rules/jsx-import.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import { TSESLint } from '@typescript-eslint/experimental-utils'
import rule from '../../src/rules/jsx-import'
import { espreeParser } from '../test-utils'
import { RuleModuleForTesting, espreeParser } from '../test-utils'

const ruleTester = new TSESLint.RuleTester({
parser: espreeParser,
Expand All @@ -17,7 +17,7 @@ const ruleTester = new TSESLint.RuleTester({
}
})

ruleTester.run('emotion jsx', rule, {
ruleTester.run('emotion jsx', rule as unknown as RuleModuleForTesting, {
valid: [
{
code: `
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-plugin/test/rules/no-vanilla.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import { TSESLint } from '@typescript-eslint/experimental-utils'
import rule from '../../src/rules/no-vanilla'
import { espreeParser } from '../test-utils'
import { espreeParser, RuleModuleForTesting } from '../test-utils'

const ruleTester = new TSESLint.RuleTester({
parser: espreeParser,
Expand All @@ -17,7 +17,7 @@ const ruleTester = new TSESLint.RuleTester({
}
})

ruleTester.run('no-vanilla', rule, {
ruleTester.run('no-vanilla', rule as unknown as RuleModuleForTesting, {
valid: [{ code: `import { css } from '@emotion/react'` }],
invalid: [
{
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-plugin/test/rules/pkg-renaming.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import { TSESLint } from '@typescript-eslint/experimental-utils'
import rule from '../../src/rules/pkg-renaming'
import { espreeParser } from '../test-utils'
import { espreeParser, RuleModuleForTesting } from '../test-utils'

const ruleTester = new TSESLint.RuleTester({
parser: espreeParser,
Expand All @@ -17,7 +17,7 @@ const ruleTester = new TSESLint.RuleTester({
}
})

ruleTester.run('pkg-renaming', rule, {
ruleTester.run('pkg-renaming', rule as unknown as RuleModuleForTesting, {
valid: [
{
code: `
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-plugin/test/rules/styled-import.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import { TSESLint } from '@typescript-eslint/experimental-utils'
import rule from '../../src/rules/styled-import'
import { espreeParser } from '../test-utils'
import { espreeParser, RuleModuleForTesting } from '../test-utils'

const ruleTester = new TSESLint.RuleTester({
parser: espreeParser,
Expand All @@ -17,7 +17,7 @@ const ruleTester = new TSESLint.RuleTester({
}
})

ruleTester.run('emotion styled', rule, {
ruleTester.run('emotion styled', rule as unknown as RuleModuleForTesting, {
valid: [
{
code: `
Expand Down
Loading