Strict Check

individual-import#

Import them individual.

Rule Options#

1{
2  rules: {
3    "sc-js/individual-import": [
4      <enabled>,
5      { "targets": <string>[] },
6    ],
7  },
8}

targets#

Specify check target modules.

value: ["react"]

Example of invalid ❌ code when above option value:

1const [state, setState] = React.useState(1)
2const changeHandler: React.ChangeEventHandler = () => {}
3const Component = () => <React.Fragment>Component</React.Fragment>
4

Example of valid ⭕ code when above option value:

1const [state, setState] = useState(1)
2const changeHandler: ChangeEventHandler = () => {}
3const Component = () => <Fragment>Component</Fragment>

back to rules of eslint-plugin-sc-js

back to eslint-plugin-sc-js top