Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: attempting to upgrade eslint #664

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
64 changes: 54 additions & 10 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,71 @@
require("@rushstack/eslint-patch/modern-module-resolution");

module.exports = {
root: true,
extends: [
"@inrupt/eslint-config-react",
"@inrupt/eslint-config-lib",
"plugin:storybook/recommended",
],
rules: {
"prettier/prettier": [
"error",
{
endOfLine: "auto",
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.eslint.json",
},
settings: {
// This is overridden currently by eslint-config-react:
"import/resolver": {
node: {
extensions: [".ts", ".tsx"],
},
],
},
},
env: {
"jest/globals": false,
},
rules: {
"react/jsx-filename-extension": [
1,
"error",
{
extensions: [".tsx"],
},
],
"import/no-unresolved": "off",
"no-shadow": "warn",
"react/require-default-props": "warn",
"react/default-props-match-prop-types": "warn",
noImplicitAny: "off",
"react/function-component-definition": [
"error",
{
namedComponents: [
"function-declaration",
"function-expression",
"arrow-function",
],
},
],
"no-shadow": [
"error",
{
allow: ["fetch", "name"],
},
],
},
overrides: [
{
files: ["src/**/*.test.tsx"],
rules: {
"react/jsx-no-constructed-context-values": "off",
},
},
// These rules need to be disabled for storybook files:
{
files: ["stories/**/*"],
rules: {
"import/no-unresolved": "off",
"react/no-unstable-nested-components": "off",
"react/function-component-definition": "off",
"no-shadow": "off",
"no-console": "off",
"@typescript-eslint/no-explicit-any": "off",
},
},
],
};
13 changes: 4 additions & 9 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
module.exports = {
// Automatically clear mock calls and instances between every test
clearMocks: true,
injectGlobals: false,

// The test environment that will be used for testing
preset: 'ts-jest',
preset: "ts-jest",
// testEnvironment: 'jsdom',
testEnvironment: "<rootDir>/tests/environment/customEnvironment.js",

testPathIgnorePatterns: [
'/node_modules/',
'/__testUtils/',
],
testPathIgnorePatterns: ["/node_modules/", "/__testUtils/"],

collectCoverage: true,
coverageReporters: process.env.CI ? ["text", "lcov"] : ["text"],

coveragePathIgnorePatterns: [
"/node_modules/",
"<rootDir>/dist",
],
coveragePathIgnorePatterns: ["/node_modules/", "<rootDir>/dist"],

coverageThreshold: {
global: {
Expand Down
Loading