Skip to content
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
12 changes: 6 additions & 6 deletions code/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ module.exports = {
project: ['./tsconfig.json'],
},
rules: {
'import/no-extraneous-dependencies': 'off',
'import-x/no-extraneous-dependencies': 'off',
'react/react-in-jsx-scope': 'off',
'import/no-unresolved': 'off', // covered by typescript
'import-x/no-unresolved': 'off', // covered by typescript
'eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }],
'eslint-comments/no-unused-disable': 'error',
'react-hooks/rules-of-hooks': 'off',
'jsx-a11y/no-autofocus': 'warn',
'import/extensions': 'off', // for mjs, we sometimes need extensions
'import-x/extensions': 'off', // for mjs, we sometimes need extensions
'jsx-a11y/control-has-associated-label': 'off',
'@typescript-eslint/dot-notation': [
'error',
Expand Down Expand Up @@ -156,14 +156,14 @@ module.exports = {
'no-dupe-class-members': 'off', // this is called overloads in typescript
'react/no-unused-prop-types': 'off', // we should use types
'react/default-props-match-prop-types': 'off', // we should use types
'import/no-named-as-default': 'warn',
'import/no-named-as-default-member': 'warn',
'import-x/no-named-as-default': 'warn',
'import-x/no-named-as-default-member': 'warn',
'react/destructuring-assignment': 'warn',

// This warns about importing interfaces and types in a normal import, it's arguably better to import with the `type` prefix separate from the runtime imports,
// I leave this as a warning right now because we haven't really decided yet, and the codebase is riddled with errors if I set to 'error'.
// It IS set to 'error' for JS files.
'import/named': 'warn',
'import-x/named': 'warn',
},
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable global-require, import/no-dynamic-require */
/* eslint-disable global-require, import-x/no-dynamic-require */

import React from 'react';

Expand Down
2 changes: 1 addition & 1 deletion code/__mocks__/inject-decorator.ugly-comments-stories.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable global-require, import/no-dynamic-require */
/* eslint-disable global-require, import-x/no-dynamic-require */

import React from 'react';

Expand Down
2 changes: 1 addition & 1 deletion code/lib/codemod/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint import/prefer-default-export: "off" */
/* eslint import-x/prefer-default-export: "off" */
import { readdirSync } from 'node:fs';
import { rename as renameAsync } from 'node:fs/promises';
import { extname, join } from 'node:path';
Expand Down
2 changes: 1 addition & 1 deletion code/lib/eslint-plugin/scripts/utils/updates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const extendsCategories: Partial<Record<CategoryId, string | null>> = {

const externalRuleOverrides: { [key: string]: string } = {
'react-hooks/rules-of-hooks': 'off',
'import/no-anonymous-default-export': 'off',
'import-x/no-anonymous-default-export': 'off',
};

export function formatRules(rules: TCategory['rules'], exclude?: string[]) {
Expand Down
2 changes: 1 addition & 1 deletion code/lib/eslint-plugin/src/configs/addon-interactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default {
files: ['**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)', '**/*.story.@(ts|tsx|js|jsx|mjs|cjs)'],
rules: {
'react-hooks/rules-of-hooks': 'off',
'import/no-anonymous-default-export': 'off',
'import-x/no-anonymous-default-export': 'off',
'storybook/await-interactions': 'error',
'storybook/context-in-play-function': 'error',
'storybook/use-storybook-expect': 'error',
Expand Down
2 changes: 1 addition & 1 deletion code/lib/eslint-plugin/src/configs/csf-strict.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default {
files: ['**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)', '**/*.story.@(ts|tsx|js|jsx|mjs|cjs)'],
rules: {
'react-hooks/rules-of-hooks': 'off',
'import/no-anonymous-default-export': 'off',
'import-x/no-anonymous-default-export': 'off',
'storybook/no-stories-of': 'error',
'storybook/no-title-property-in-meta': 'error',
} as const,
Expand Down
2 changes: 1 addition & 1 deletion code/lib/eslint-plugin/src/configs/csf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default {
files: ['**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)', '**/*.story.@(ts|tsx|js|jsx|mjs|cjs)'],
rules: {
'react-hooks/rules-of-hooks': 'off',
'import/no-anonymous-default-export': 'off',
'import-x/no-anonymous-default-export': 'off',
'storybook/csf-component': 'warn',
'storybook/default-exports': 'error',
'storybook/hierarchy-separator': 'warn',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default [
files: ['**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)', '**/*.story.@(ts|tsx|js|jsx|mjs|cjs)'],
rules: {
'react-hooks/rules-of-hooks': 'off',
'import/no-anonymous-default-export': 'off',
'import-x/no-anonymous-default-export': 'off',
'storybook/await-interactions': 'error',
'storybook/context-in-play-function': 'error',
'storybook/use-storybook-expect': 'error',
Expand Down
2 changes: 1 addition & 1 deletion code/lib/eslint-plugin/src/configs/flat/csf-strict.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default [
files: ['**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)', '**/*.story.@(ts|tsx|js|jsx|mjs|cjs)'],
rules: {
'react-hooks/rules-of-hooks': 'off',
'import/no-anonymous-default-export': 'off',
'import-x/no-anonymous-default-export': 'off',
'storybook/no-stories-of': 'error',
'storybook/no-title-property-in-meta': 'error',
} as const,
Expand Down
2 changes: 1 addition & 1 deletion code/lib/eslint-plugin/src/configs/flat/csf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default [
files: ['**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)', '**/*.story.@(ts|tsx|js|jsx|mjs|cjs)'],
rules: {
'react-hooks/rules-of-hooks': 'off',
'import/no-anonymous-default-export': 'off',
'import-x/no-anonymous-default-export': 'off',
'storybook/csf-component': 'warn',
'storybook/default-exports': 'error',
'storybook/hierarchy-separator': 'warn',
Expand Down
2 changes: 1 addition & 1 deletion code/lib/eslint-plugin/src/configs/flat/recommended.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default [
files: ['**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)', '**/*.story.@(ts|tsx|js|jsx|mjs|cjs)'],
rules: {
'react-hooks/rules-of-hooks': 'off',
'import/no-anonymous-default-export': 'off',
'import-x/no-anonymous-default-export': 'off',
'storybook/await-interactions': 'error',
'storybook/context-in-play-function': 'error',
'storybook/default-exports': 'error',
Expand Down
2 changes: 1 addition & 1 deletion code/lib/eslint-plugin/src/configs/recommended.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default {
files: ['**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)', '**/*.story.@(ts|tsx|js|jsx|mjs|cjs)'],
rules: {
'react-hooks/rules-of-hooks': 'off',
'import/no-anonymous-default-export': 'off',
'import-x/no-anonymous-default-export': 'off',
'storybook/await-interactions': 'error',
'storybook/context-in-play-function': 'error',
'storybook/default-exports': 'error',
Expand Down
2 changes: 1 addition & 1 deletion code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-file-progress": "^1.4.0",
"eslint-plugin-html": "^6.2.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-import-x": "^4.16.1",
"eslint-plugin-json": "^4.0.0",
"eslint-plugin-json-files": "^4.1.0",
"eslint-plugin-jsx-a11y": "^6.8.0",
Expand Down
12 changes: 6 additions & 6 deletions scripts/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
'plugin:@typescript-eslint/recommended',
'plugin:depend/recommended',
'plugin:eslint-comments/recommended',
'plugin:import/react-native',
'plugin:import-x/react-native',
'plugin:prettier/recommended',
'plugin:react-hooks/recommended',
'plugin:react/recommended',
Expand All @@ -29,9 +29,9 @@ module.exports = {
version: 'detect',
},
'html/html-extensions': ['.html'],
'import/core-modules': ['enzyme'],
'import/ignore': ['node_modules\\/(?!@storybook)'],
'import/resolver': {
'import-x/core-modules': ['enzyme'],
'import-x/ignore': ['node_modules\\/(?!@storybook)'],
'import-x/resolver': {
node: {
extensions: ['.js', '.ts', '.tsx', '.mjs', '.d.ts'],
paths: ['node_modules/', 'node_modules/@types/'],
Expand All @@ -43,7 +43,7 @@ module.exports = {
'compat',
'file-progress',
'@typescript-eslint',
'import',
'import-x',
'json',
'html',
'prettier',
Expand Down Expand Up @@ -82,7 +82,7 @@ module.exports = {
{
files: ['*.mjs'],
rules: {
'import/extensions': ['error', 'always'],
'import-x/extensions': ['error', 'always'],
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-file-progress": "^1.4.0",
"eslint-plugin-html": "^6.2.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-import-x": "^4.16.1",
"eslint-plugin-json": "^4.0.0",
"eslint-plugin-json-files": "^4.1.0",
"eslint-plugin-jsx-a11y": "^6.8.0",
Expand Down
2 changes: 1 addition & 1 deletion test-storybooks/ember-cli/app/router.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// eslint-disable import/extensions
// eslint-disable import-x/extensions
import EmberRouter from '@ember/routing/router';
import config from './config/environment';

Expand Down
Loading
Loading