Line 3:1: Expected an assignment or function call and instead saw an expression no-unused-expressions. This is my first time using 'use restrict" in javascript and I don't know how to fix the rule that is against.
My Nav.js file in react
import React from 'react';
'use strict';
function Nav() {
return (
<nav>
<ul>
<li> About </li>
<li> Shop </li>
</ul>
</nav>
);
}
export default Nav;
To invoke strict mode for an entire script, put the exact statement
"use strict";(or'use strict';) before any other statements.
Since you put that string literal after your imports, it is just a string literal expression. It doesn't trigger strict mode. It doesn't do anything (because you don't assign it / pass it / etc).
Move it so it is the very first line of your JS.