Skip to content

Commit

Permalink
enforce the rule for the other repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Oct 25, 2022
1 parent 2d45217 commit a6ad3d3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
18 changes: 14 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const path = require('path');
const { rules: baseStyleRules } = require('eslint-config-airbnb-base/rules/style');

const forbidTopLevelMessage = [
'Prefer one level nested imports to avoid bundling everything in dev mode',
Expand All @@ -19,10 +20,10 @@ module.exports = {
node: true,
},
extends: [
'plugin:import/recommended',
'plugin:import/typescript',
'airbnb-typescript',
'prettier',
'plugin:eslint-plugin-import/recommended',
'plugin:eslint-plugin-import/typescript',
'eslint-config-airbnb-typescript',
'eslint-config-prettier',
],
parser: '@typescript-eslint/parser',
parserOptions: {
Expand Down Expand Up @@ -161,6 +162,15 @@ module.exports = {
'react/static-property-placement': 'off',
// Currently not in recommended ruleset but catches real bugs.
'react/no-unstable-nested-components': 'error',
'no-restricted-syntax': [
// See https://github.com/eslint/eslint/issues/9192 for why it's needed
...baseStyleRules['no-restricted-syntax'],
{
message:
"Do not import default from React. Use a namespace import (import * as React from 'react';) instead.",
selector: 'ImportDeclaration[source.value="react"] ImportDefaultSpecifier',
},
],
},
overrides: [
{
Expand Down
4 changes: 2 additions & 2 deletions packages/mui-base/src/SwitchUnstyled/useSwitch.types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { HTMLInputTypeAttribute } from 'react';
import * as React from 'react';

export interface UseSwitchParameters {
/**
Expand Down Expand Up @@ -44,7 +44,7 @@ interface UseSwitchInputSlotOwnProps {
readOnly?: boolean;
ref: React.Ref<any>;
required?: boolean;
type: HTMLInputTypeAttribute;
type: React.HTMLInputTypeAttribute;
}

export type UseSwitchInputSlotProps<TOther = {}> = Omit<TOther, keyof UseSwitchInputSlotOwnProps> &
Expand Down

0 comments on commit a6ad3d3

Please sign in to comment.