123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- /*
- * Copyright 2018-2022 Elyra Authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- const allExtensions = [".ts", ".tsx", ".d.ts", ".js", ".jsx"];
- module.exports = {
- root: true,
- extends: [
- "react-app",
- "plugin:jest/recommended",
- "plugin:jest/style",
- "plugin:testing-library/react",
- "plugin:jest-dom/recommended",
- ],
- plugins: ["import", "header"],
- rules: {
- "testing-library/prefer-screen-queries": ["warn"],
- "jest/expect-expect": ["off"],
- "jest/valid-title": ["off"],
- "header/header": [
- "warn",
- "block",
- [
- "",
- " * Copyright 2018-2022 Elyra Authors",
- " *",
- ' * Licensed under the Apache License, Version 2.0 (the "License");',
- " * you may not use this file except in compliance with the License.",
- " * You may obtain a copy of the License at",
- " *",
- " * http://www.apache.org/licenses/LICENSE-2.0",
- " *",
- " * Unless required by applicable law or agreed to in writing, software",
- ' * distributed under the License is distributed on an "AS IS" BASIS,',
- " * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
- " * See the License for the specific language governing permissions and",
- " * limitations under the License.",
- " ",
- ],
- 2,
- ],
- "import/newline-after-import": ["warn", { count: 1 }],
- "import/no-extraneous-dependencies": [
- "warn",
- {
- devDependencies: false,
- optionalDependencies: false,
- peerDependencies: true,
- bundledDependencies: true,
- },
- ],
- "import/order": [
- "warn",
- {
- alphabetize: {
- order: "asc",
- caseInsensitive: true,
- },
- "newlines-between": "always",
- groups: [
- "builtin",
- "external",
- "internal",
- ["parent", "sibling", "index"],
- "object",
- ],
- pathGroups: [
- {
- pattern: "react?(-dom)",
- group: "external",
- position: "before",
- },
- {
- pattern: "@iris/**",
- group: "external",
- position: "after",
- },
- ],
- pathGroupsExcludedImportTypes: ["builtin"],
- },
- ],
- },
- overrides: [
- {
- files: ["cypress/**"],
- rules: {
- "testing-library/prefer-screen-queries": "off",
- },
- },
- {
- files: ["stories/**"],
- rules: {
- "import/no-anonymous-default-export": ["off"],
- "import/no-extraneous-dependencies": "off",
- },
- },
- {
- files: [
- "webpack.*.js",
- "*.test.{ts,tsx}",
- "test-utils.{ts,tsx}",
- "cypress/**",
- ],
- rules: {
- "import/no-extraneous-dependencies": [
- "warn",
- {
- devDependencies: true,
- optionalDependencies: false,
- peerDependencies: false,
- bundledDependencies: true,
- },
- ],
- },
- },
- ],
- settings: {
- "import/extensions": allExtensions,
- "import/external-module-folders": ["node_modules", "node_modules/@types"],
- "import/parsers": {
- "@typescript-eslint/parser": [".ts", ".tsx", ".d.ts"],
- },
- "import/resolver": {
- node: {
- extensions: allExtensions,
- },
- },
- },
- };
|