From 190e6b446c76aa55b02c31493651fcdea1fc7e30 Mon Sep 17 00:00:00 2001 From: Rory Hunter Date: Fri, 31 May 2019 15:13:24 +0100 Subject: [PATCH] Retire TSlint (#1950) This PR retires TSLint in favour of ESLint. Consolidating the linting rules meant I needed to make a call about what the rules should be going forward - I'm very happy to discuss / change them. There's a lot of tedious quote changes, but I think that was unavoidable given the disparate linting configs. I also expanded the linting / type-checking to cover src-framer. I did my best to patch up the code here. --- .eslintignore | 9 + .eslintrc.js | 30 +- CHANGELOG.md | 1 + package.json | 39 +- scripts/dtsgenerator.js | 44 +- scripts/eslint-plugin-i18n/i18n.js | 6 +- src-docs/.eslintrc.js | 6 + .../components/guide_section/guide_section.js | 8 +- src-docs/src/i18ntokens.json | 20 +- src-docs/src/routes.js | 2 +- src-docs/src/views/card/card_image.js | 2 +- src-docs/src/views/card/card_layout.js | 10 +- .../context_menu/context_menu_example.js | 6 +- .../drag_and_drop/drag_and_drop_example.js | 12 +- src-docs/src/views/flex/flex_example.js | 2 +- src-docs/src/views/guidelines/sass.js | 4 +- .../src/views/header/global_filter_item.js | 2 +- src-docs/src/views/icon/icon_example.js | 26 +- src-docs/src/views/icon/icon_types.js | 4 +- src-docs/src/views/loading/loading_example.js | 8 +- .../src/views/progress/progress_example.js | 2 +- .../views/responsive/responsive_example.js | 2 +- src-docs/src/views/search_bar/props_info.js | 3 +- .../views/selectable/selectable_example.js | 2 +- .../stacked_horizontal_bar_series.js | 4 +- .../stacked_vertical_bar_series.js | 4 +- .../stacked_horizontal_rect_series.js | 4 +- .../stacked_vertical_rect_series.js | 4 +- .../series_chart_line/custom_style_line.js | 2 +- src-docs/src/views/tables/basic/props_info.js | 27 +- .../src/views/tables/in_memory/props_info.js | 2 +- src-docs/src/views/toast/toast_list.js | 3 +- src-docs/tslint.yaml | 2 - src-docs/webpack.config.js | 3 +- src-framer/.eslintrc.js | 11 + src-framer/code/App.tsx | 3 +- src-framer/code/Examples.tsx | 12 +- .../code/_framer_helpers/frame_size.tsx | 2 +- src-framer/code/_framer_helpers/theme.tsx | 4 +- src-framer/code/avatar/avatar.tsx | 2 + src-framer/code/badge/badge.tsx | 6 +- src-framer/code/button/button.tsx | 6 +- src-framer/code/call_out/call_out.tsx | 6 +- src-framer/code/canvas.tsx | 2 +- src-framer/code/card/card.tsx | 12 +- src-framer/code/code/code_block.tsx | 2 + .../description_list/description_list.tsx | 3 + src-framer/code/facet/facet.tsx | 8 +- src-framer/code/forms/field_password.tsx | 6 +- src-framer/code/forms/field_search.tsx | 6 +- src-framer/code/forms/field_text.tsx | 7 +- src-framer/code/icon/icon.tsx | 1 + src-framer/code/panel/panel.tsx | 7 +- src-framer/code/text/text.tsx | 3 + src-framer/code/title/title.tsx | 1 + src-framer/custom_typings/framer/index.d.ts | 67 ++ src-framer/tsconfig.json | 38 - .../keyboard_accessible.test.tsx | 12 +- src/components/accordion/index.d.ts | 1 + src/components/avatar/avatar.tsx | 6 +- .../basic_table/basic_table.test.js | 4 +- .../breadcrumbs/breadcrumbs.test.js | 2 +- src/components/button/index.d.ts | 104 ++- src/components/call_out/index.d.ts | 14 +- src/components/card/card.test.js | 2 +- src/components/code/index.d.ts | 7 +- .../code_editor/code_editor.test.js | 2 +- src/components/combo_box/combo_box.js | 10 +- src/components/combo_box/combo_box.test.js | 8 +- .../combo_box_input/combo_box_input.js | 2 +- .../combo_box_options_list.js | 6 +- src/components/combo_box/index.d.ts | 17 +- .../combo_box/matching_options.test.ts | 2 +- src/components/combo_box/matching_options.ts | 2 +- src/components/context/context.tsx | 4 +- src/components/context_menu/context_menu.js | 7 +- .../context_menu/context_menu_item.test.js | 2 +- .../context_menu/context_menu_panel.js | 16 +- .../context_menu/context_menu_panel.test.js | 16 +- src/components/context_menu/index.d.ts | 5 +- src/components/copy/copy.js | 6 +- src/components/date_picker/index.d.ts | 4 +- .../date_picker/react-datepicker.d.ts | 24 +- .../super_date_picker/async_interval.test.js | 2 +- .../date_popover/absolute_tab.js | 2 +- .../date_popover/relative_tab.js | 6 +- .../super_date_picker/relative_utils.js | 6 +- src/components/empty_prompt/index.d.ts | 6 +- src/components/error_boundary/index.d.ts | 3 +- src/components/facet/index.d.ts | 14 +- src/components/filter_group/index.d.ts | 14 +- src/components/focus_trap/index.d.ts | 6 +- src/components/form/checkbox/checkbox.test.js | 2 +- src/components/form/checkbox/index.d.ts | 16 +- .../described_form_group.test.js | 10 +- .../form/field_number/field_number.js | 2 +- .../form/field_number/field_number.test.js | 10 +- src/components/form/field_number/index.d.ts | 3 +- .../field_password/field_password.test.js | 6 +- src/components/form/field_password/index.d.ts | 1 - .../form/field_search/field_search.js | 2 +- .../form/field_search/field_search.test.js | 6 +- .../form/field_text/field_text.test.js | 6 +- src/components/form/field_text/index.d.ts | 3 +- .../form/file_picker/file_picker.js | 2 +- .../form_control_layout_icons.js | 6 +- src/components/form/form_row/form_row.js | 2 +- src/components/form/form_row/form_row.test.js | 32 +- src/components/form/form_row/index.d.ts | 2 +- src/components/form/index.d.ts | 1 - src/components/form/radio/index.d.ts | 7 +- src/components/form/range/dual_range.js | 2 +- src/components/form/range/index.d.ts | 19 +- src/components/form/range/range.js | 8 +- src/components/form/select/index.d.ts | 34 +- src/components/form/super_select/index.d.ts | 106 +-- .../form/super_select/super_select.test.js | 2 +- .../super_select/super_select_control.test.js | 2 +- src/components/form/switch/switch.js | 2 +- src/components/form/switch/switch.test.js | 2 +- src/components/form/text_area/index.d.ts | 3 +- .../__snapshots__/header_logo.test.tsx.snap | 3 + src/components/header/header_logo.tsx | 7 +- .../header_section_item_button.test.js | 2 +- src/components/health/index.d.ts | 2 +- src/components/highlight/highlight.test.js | 2 +- src/components/i18n/i18n.test.tsx | 2 + src/components/icon/icon.tsx | 8 +- src/components/index.d.ts | 2 +- src/components/key_pad_menu/index.d.ts | 17 +- .../key_pad_menu/key_pad_menu_item.test.js | 2 +- src/components/link/index.d.ts | 6 +- src/components/list_group/index.d.ts | 42 +- src/components/modal/confirm_modal.js | 2 +- .../observer/mutation_observer/index.d.ts | 7 +- .../observer/resize_observer/index.d.ts | 5 +- src/components/page/index.d.ts | 36 +- src/components/popover/popover.js | 6 +- src/components/popover/wrapping_popover.js | 6 +- .../filters/field_value_selection_filter.js | 2 +- .../query/ast_to_es_query_dsl.test.js | 24 +- .../query/ast_to_es_query_string.test.js | 24 +- .../search_bar/query/default_syntax.test.js | 82 +- src/components/selectable/matching_options.ts | 68 +- src/components/selectable/selectable.test.tsx | 2 +- .../selectable_list/selectable_list.test.tsx | 2 +- .../selectable_list/selectable_list.tsx | 1 + .../selectable_list/selectable_list_item.tsx | 4 +- .../selectable_search/selectable_search.tsx | 2 +- .../series_chart/crosshairs/crosshair_y.js | 2 +- .../series_chart/selection_brush.test.js | 10 +- .../series_chart/series_chart.test.js | 4 +- src/components/series_chart/status-text.js | 2 +- src/components/side_nav/side_nav.js | 4 +- src/components/side_nav/side_nav_item.test.js | 2 +- src/components/spacer/spacer.tsx | 4 +- src/components/stat/stat.test.tsx | 2 +- src/components/stat/stat.tsx | 3 +- .../__snapshots__/step_number.test.tsx.snap | 3 + .../steps_horizontal.test.js.snap | 1 + src/components/steps/index.d.ts | 66 +- src/components/steps/step_horizontal.test.js | 2 +- src/components/steps/step_number.tsx | 32 +- src/components/table/index.d.ts | 11 +- .../table/table_pagination/index.d.ts | 2 - src/components/table/table_row_cell.test.js | 2 +- src/components/tabs/index.d.ts | 12 +- .../tabs/tabbed_content/tabbed_content.js | 4 +- .../tabbed_content/tabbed_content.test.js | 6 +- src/components/toast/global_toast_list.js | 10 +- src/components/toggle/toggle.tsx | 3 +- src/components/token/index.d.ts | 2 +- src/components/tool_tip/index.d.ts | 14 +- src/custom_typings/index.d.ts | 4 +- src/services/browser/browser.ts | 2 + src/services/copy_to_clipboard.ts | 6 +- src/services/format/format_date.ts | 30 +- src/services/predicate/common_predicates.ts | 4 +- src/services/random.ts | 4 +- src/services/string/to_initials.ts | 2 +- src/services/url.test.ts | 8 +- src/services/utils.ts | 3 + src/themes/index.d.ts | 6 +- src/webpack.config.js | 5 +- tsconfig.json | 8 +- tslint.yaml | 14 - yarn.lock | 834 ++++++++++-------- 187 files changed, 1486 insertions(+), 1178 deletions(-) create mode 100644 src-docs/.eslintrc.js delete mode 100644 src-docs/tslint.yaml create mode 100644 src-framer/.eslintrc.js create mode 100644 src-framer/custom_typings/framer/index.d.ts delete mode 100644 src-framer/tsconfig.json delete mode 100644 tslint.yaml diff --git a/.eslintignore b/.eslintignore index 8357fcaaed4..e99d1152536 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,10 @@ +dist +node_modules es +lib +types +eui.d.ts +**/*.snap.js +**/assets/**/*.js +src-docs/src/views/icon/icon_example.js +src-framer/code/canvas.tsx diff --git a/.eslintrc.js b/.eslintrc.js index 8773f073887..c91f8dfc9ad 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,16 +1,26 @@ module.exports = { + parser: "@typescript-eslint/parser", + parserOptions: { + ecmaFeatures: { + jsx: true + } + }, settings: { "import/resolver": { node: { - extensions: [".js"] + extensions: [".ts", ".tsx", ".js", ".json"] }, webpack: { config: "./src-docs/webpack.config.js" } + }, + react: { + version: "detect" } }, extends: [ "@elastic/eslint-config-kibana", + "plugin:@typescript-eslint/recommended", // Prettier options need to come last, in order to override other style // rules. "prettier/react", @@ -23,7 +33,23 @@ module.exports = { ], rules: { "prefer-template": "error", - "local/i18n": "error" + "local/i18n": "error", + "no-use-before-define": "off", + "quotes": ["warn", "single", "avoid-escape"], + + "@typescript-eslint/array-type": ["error", "array-simple"], + "@typescript-eslint/camelcase": "off", + "@typescript-eslint/class-name-casing": "off", + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/explicit-member-accessibility": "off", + "@typescript-eslint/indent": "off", + "@typescript-eslint/no-empty-interface": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-parameter-properties": "off", + "@typescript-eslint/no-triple-slash-reference": "off", + "@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_", "ignoreRestSiblings": true }], + "@typescript-eslint/no-use-before-define": "off", }, env: { jest: true diff --git a/CHANGELOG.md b/CHANGELOG.md index e4f0246de43..080f35d8885 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - Added ability to update `EuiInMemoryTable` `sorting` prop and remove columns after sorting is applied ([#1972](https://github.com/elastic/eui/pull/1972)) - Added `onToggle` callback to `EuiAccordion` ([#1974](https://github.com/elastic/eui/pull/1974)) - Removed `options` `defaultProps` value from `EuiSuperSelect` ([#1975](https://github.com/elastic/eui/pull/1975)) +- Remove TSlint and perform all linting through ESLint ([#1950](https://github.com/elastic/eui/pull/1950)) **Bug fixes** diff --git a/package.json b/package.json index d5d3ee2a3c2..f22409c33a7 100644 --- a/package.json +++ b/package.json @@ -17,16 +17,12 @@ "build": "yarn extract-i18n-strings && node ./scripts/compile-clean.js && node ./scripts/compile-eui.js && node ./scripts/compile-scss.js $npm_package_name", "compile-icons": "node ./scripts/compile-icons.js && prettier --write --loglevel=warn \"./src/components/icon/assets/**/*.js\"", "extract-i18n-strings": "node ./scripts/babel/fetch-i18n-strings", - "lint": "yarn lint-es && yarn lint-ts && yarn lint-sass && yarn lint-framer", - "lint-fix": "yarn lint-es-fix && yarn lint-ts-fix", - "lint-es": "eslint --cache --ignore-pattern \"**/*.snap.js\", --ignore-pattern \"**/assets/**/*.js\" \"src/**/*.js\" \"src-docs/**/*.js\"", - "lint-es-fix": "eslint --fix --cache --ignore-pattern \"**/*.snap.js\", \"**/assets/**/*.js\" \"src/**/*.js\" \"src-docs/**/*.js\"", + "lint": "yarn tsc --noEmit && yarn lint-es && yarn lint-sass", + "lint-fix": "yarn lint-es-fix", + "lint-es": "eslint --cache '{src,src-docs,src-framer}/**/*.{ts,tsx,js}'", + "lint-es-fix": "yarn lint-es --fix", "lint-sass": "sass-lint -v --max-warnings 0", "lint-sass-fix": "sass-lint-auto-fix -c ./.sass-lint-fix.yml", - "lint-ts": "tsc -p ./tsconfig.json --noEmit && tslint -c ./tslint.yaml -p ./tsconfig.json", - "lint-ts-fix": "tslint -c ./tslint.yaml -p ./tsconfig.json --fix", - "lint-framer": "tslint -c ./tslint.yaml -p ./src-framer/tsconfig.json", - "lint-framer-fix": "tslint -c ./tslint.yaml -p ./src-framer/tsconfig.json --fix", "test": "yarn lint && yarn test-unit", "test-unit": "cross-env NODE_ENV=test jest --config ./scripts/jest/config.json", "start-test-server": "webpack-dev-server --config src-docs/webpack.config.js --port 9999", @@ -90,9 +86,11 @@ "@types/react-is": "~16.3.0", "@types/react-virtualized": "^9.18.6", "@types/uuid": "^3.4.4", + "@typescript-eslint/eslint-plugin": "^1.9.0", + "@typescript-eslint/parser": "^1.9.0", "autoprefixer": "^7.1.5", "babel-core": "7.0.0-bridge.0", - "babel-eslint": "^8.0.1", + "babel-eslint": "^10.0.1", "babel-jest": "^24.1.0", "babel-loader": "^8.0.4", "babel-plugin-add-module-exports": "^1.0.0", @@ -115,18 +113,18 @@ "enzyme": "^3.9.0", "enzyme-adapter-react-16": "^1.9.1", "enzyme-to-json": "^3.3.0", - "eslint": "^4.9.0", + "eslint": "^5.16.0", "eslint-config-prettier": "^4.2.0", - "eslint-import-resolver-webpack": "^0.8.3", - "eslint-plugin-babel": "^4.1.2", - "eslint-plugin-import": "^2.8.0", - "eslint-plugin-jest": "^21.6.2", - "eslint-plugin-jsx-a11y": "^6.0.2", + "eslint-import-resolver-webpack": "^0.11.1", + "eslint-plugin-babel": "^5.3.0", + "eslint-plugin-import": "^2.17.2", + "eslint-plugin-jest": "^22.5.1", + "eslint-plugin-jsx-a11y": "^6.2.1", "eslint-plugin-local": "^1.0.0", - "eslint-plugin-mocha": "^4.11.0", + "eslint-plugin-mocha": "^5.3.0", "eslint-plugin-prefer-object-spread": "^1.2.1", - "eslint-plugin-prettier": "^3.0.1", - "eslint-plugin-react": "^7.4.0", + "eslint-plugin-prettier": "^3.1.0", + "eslint-plugin-react": "^7.13.0", "file-loader": "^1.1.11", "findup": "^0.1.5", "fork-ts-checker-webpack-plugin": "^0.4.4", @@ -170,9 +168,6 @@ "sinon": "^4.4.8", "start-server-and-test": "^1.1.4", "style-loader": "^0.19.0", - "tslint": "^5.11.0", - "tslint-config-prettier": "^1.18.0", - "tslint-plugin-prettier": "^2.0.1", "typescript": "^3.3.3", "uglifyjs-webpack-plugin": "^2.0.1", "url-loader": "^1.0.1", @@ -197,6 +192,6 @@ "prop-types": "^15.5.0", "react": "^16.8", "react-dom": "^16.8", - "typescript": "^3.3.0" + "typescript": "^3.3.3" } } diff --git a/scripts/dtsgenerator.js b/scripts/dtsgenerator.js index a494fe78ee4..ba6a6f35f6a 100644 --- a/scripts/dtsgenerator.js +++ b/scripts/dtsgenerator.js @@ -8,7 +8,8 @@ const baseDir = path.resolve(__dirname, '..'); const srcDir = path.resolve(baseDir, 'src'); function hasParentIndex(pathToFile) { - const isIndexFile = path.basename(pathToFile, path.extname(pathToFile)) === 'index'; + const isIndexFile = + path.basename(pathToFile, path.extname(pathToFile)) === 'index'; try { const fileDirectory = path.dirname(pathToFile); const parentIndex = findup.sync( @@ -27,9 +28,16 @@ const generator = dtsGenerator({ name: '@elastic/eui', project: baseDir, out: 'eui.d.ts', - exclude: ['node_modules/**/*.d.ts', 'src/custom_typings/**/*.d.ts'], + exclude: [ + 'node_modules/**/*.d.ts', + '*/custom_typings/**/*.d.ts', + 'src-framer/**/*', + ], resolveModuleId(params) { - if (path.basename(params.currentModuleId) === 'index' && !hasParentIndex(path.resolve(baseDir, params.currentModuleId))) { + if ( + path.basename(params.currentModuleId) === 'index' && + !hasParentIndex(path.resolve(baseDir, params.currentModuleId)) + ) { // this module is exporting from an `index(.d)?.ts` file, declare its exports straight to @elastic/eui module return '@elastic/eui'; } else { @@ -43,20 +51,20 @@ const generator = dtsGenerator({ }, resolveModuleImport(params) { // only intercept relative imports (don't modify node-modules references) - const importFromBaseDir = path.resolve(baseDir, path.dirname(params.currentModuleId)); + const importFromBaseDir = path.resolve( + baseDir, + path.dirname(params.currentModuleId) + ); const isFromEuiSrc = importFromBaseDir.startsWith(srcDir); const isRelativeImport = isFromEuiSrc && params.importedModuleId[0] === '.'; if (isRelativeImport) { // if importing from an `index` file (directly or targeting a directory with an index), // then if there is no parent index file this should import from @elastic/eui - const importPathTarget = resolve.sync( - params.importedModuleId, - { - basedir: importFromBaseDir, - extensions: ['.ts', '.tsx', '.d.ts'], - } - ); + const importPathTarget = resolve.sync(params.importedModuleId, { + basedir: importFromBaseDir, + extensions: ['.ts', '.tsx', '.d.ts'], + }); const isIndexFile = importPathTarget.endsWith('/index.ts'); const isModuleIndex = isIndexFile && !hasParentIndex(importPathTarget); @@ -87,10 +95,13 @@ generator.then(() => { fs.writeFileSync( defsFilePath, - fs.readFileSync(defsFilePath).toString() + fs + .readFileSync(defsFilePath) + .toString() .replace(/\/\/\/\W+ { // However, @babel/preset-typescript doesn't understand some syntax generated in eui.d.ts // and the tooling around typescript's parsing & code generation is lacking and undocumented // so... because this works with the guarantee that the newline-brace combination matches a module... - /declare module '(.*?)' {.*?^}/smg, + /declare module '(.*?)' {.*?^}/gms, (module, moduleName) => { // `moduleName` is the namespace for this ambient module return module.replace( // replace relative imports by attaching them to the module's namespace /import\("([.]{1,2}\/.*?)"\)/g, (importStatement, importPath) => { - const target = path.join( - path.dirname(moduleName), - importPath - ); + const target = path.join(path.dirname(moduleName), importPath); return `import ("${target}")`; } ); diff --git a/scripts/eslint-plugin-i18n/i18n.js b/scripts/eslint-plugin-i18n/i18n.js index c7fdd820c01..c4141ef2525 100644 --- a/scripts/eslint-plugin-i18n/i18n.js +++ b/scripts/eslint-plugin-i18n/i18n.js @@ -1,5 +1,7 @@ // Enforce EuiI18n token names & variable names in render prop +/* eslint-disable @typescript-eslint/no-var-requires */ + const path = require('path'); function attributesArrayToLookup(attributesArray) { @@ -13,7 +15,7 @@ function attributesArrayToLookup(attributesArray) { } function getDefinedValues(valuesNode) { - if (valuesNode == null) return new Set(); + if (valuesNode == null || valuesNode.expression.properties == null) return new Set(); return valuesNode.expression.properties.reduce( (valueNames, property) => { valueNames.add(property.key.name); @@ -239,7 +241,7 @@ module.exports = { // default is a function // validate the destructured param defined by default function match the values const defaultFn = attributes.default.expression; - const objProperties = defaultFn.params ? defaultFn.params[0].properties : []; + const objProperties = defaultFn.params && defaultFn.params[0] ? defaultFn.params[0].properties : []; const expectedNames = new Set(objProperties.map(property => property.key.name)); if (areSetsEqual(valueNames, expectedNames) === false) { context.report({ diff --git a/src-docs/.eslintrc.js b/src-docs/.eslintrc.js new file mode 100644 index 00000000000..a57d1016ac0 --- /dev/null +++ b/src-docs/.eslintrc.js @@ -0,0 +1,6 @@ +module.exports = { + extends: '../.eslintrc.js', + rules: { + '@typescript-eslint/no-var-requires': 'off', + } +} diff --git a/src-docs/src/components/guide_section/guide_section.js b/src-docs/src/components/guide_section/guide_section.js index bad9b6a4e19..eb8d9aed087 100644 --- a/src-docs/src/components/guide_section/guide_section.js +++ b/src-docs/src/components/guide_section/guide_section.js @@ -367,16 +367,16 @@ export class GuideSection extends Component { sourceObject => sourceObject.type === name ); const npmImports = code - .replace(/(from )'(..\/)+src\/components(\/?';)/, `from '@elastic/eui';`) + .replace(/(from )'(..\/)+src\/components(\/?';)/, "from '@elastic/eui';") .replace( /(from )'(..\/)+src\/services(\/?';)/, - `from '@elastic/eui/lib/services';` + "from '@elastic/eui/lib/services';" ) .replace( /(from )'(..\/)+src\/experimental(\/?';)/, - `from '@elastic/eui/lib/experimental';` + "from '@elastic/eui/lib/experimental';" ) - .replace(/(from )'(..\/)+src\/components\/.*?';/, `from '@elastic/eui';`); + .replace(/(from )'(..\/)+src\/components\/.*?';/, "from '@elastic/eui';"); return (
diff --git a/src-docs/src/i18ntokens.json b/src-docs/src/i18ntokens.json index 075235b16ec..78e2865b886 100644 --- a/src-docs/src/i18ntokens.json +++ b/src-docs/src/i18ntokens.json @@ -421,11 +421,11 @@ "highlighting": "string", "loc": { "start": { - "line": 75, + "line": 77, "column": 12 }, "end": { - "line": 79, + "line": 81, "column": 14 } }, @@ -661,11 +661,11 @@ "highlighting": "string", "loc": { "start": { - "line": 104, + "line": 103, "column": 6 }, "end": { - "line": 104, + "line": 103, "column": 74 } }, @@ -709,11 +709,11 @@ "highlighting": "string", "loc": { "start": { - "line": 49, + "line": 55, "column": 6 }, "end": { - "line": 49, + "line": 55, "column": 67 } }, @@ -725,11 +725,11 @@ "highlighting": "string", "loc": { "start": { - "line": 55, + "line": 67, "column": 6 }, "end": { - "line": 55, + "line": 67, "column": 72 } }, @@ -741,11 +741,11 @@ "highlighting": "string", "loc": { "start": { - "line": 61, + "line": 79, "column": 6 }, "end": { - "line": 61, + "line": 79, "column": 68 } }, diff --git a/src-docs/src/routes.js b/src-docs/src/routes.js index cbb6b8abdc2..67882fc71cc 100644 --- a/src-docs/src/routes.js +++ b/src-docs/src/routes.js @@ -206,7 +206,7 @@ const slugify = str => { const createExample = example => { if (!example) { throw new Error( - `One of your example pages is undefined. This usually happens when you export or import it with the wrong name.` + 'One of your example pages is undefined. This usually happens when you export or import it with the wrong name.' ); } diff --git a/src-docs/src/views/card/card_image.js b/src-docs/src/views/card/card_image.js index 3e823a5001f..34f20c7c6da 100644 --- a/src-docs/src/views/card/card_image.js +++ b/src-docs/src/views/card/card_image.js @@ -42,7 +42,7 @@ export default () => ( href="https://elastic.github.io/eui/" image="https://source.unsplash.com/400x200/?City" icon={} - title={`Beats in the City`} + title={'Beats in the City'} description="This card has an href and should be a link." /> diff --git a/src-docs/src/views/card/card_layout.js b/src-docs/src/views/card/card_layout.js index d4b6854dad2..84a1baac78d 100644 --- a/src-docs/src/views/card/card_layout.js +++ b/src-docs/src/views/card/card_layout.js @@ -12,8 +12,8 @@ export default () => ( } - title={`Elastic Beats`} + icon={} + title={'Elastic Beats'} description="Example of a card's description. Stick to one or two sentences." onClick={() => window.alert('Card clicked')} /> @@ -21,8 +21,8 @@ export default () => ( } - title={`Elastic Cloud`} + icon={} + title={'Elastic Cloud'} description="Example of a card's description. Stick to one or two sentences." onClick={() => window.alert('Card clicked')} /> @@ -30,7 +30,7 @@ export default () => ( window.alert('Card clicked')} /> diff --git a/src-docs/src/views/context_menu/context_menu_example.js b/src-docs/src/views/context_menu/context_menu_example.js index edf5a2a9aeb..fa850cde0f0 100644 --- a/src-docs/src/views/context_menu/context_menu_example.js +++ b/src-docs/src/views/context_menu/context_menu_example.js @@ -54,7 +54,7 @@ export const ContextMenuExample = { demo: , }, { - title: `With single panel`, + title: 'With single panel', source: [ { type: GuideSectionTypes.JS, @@ -74,7 +74,7 @@ export const ContextMenuExample = { demo: , }, { - title: `Displaying custom elements`, + title: 'Displaying custom elements', source: [ { type: GuideSectionTypes.JS, @@ -95,7 +95,7 @@ export const ContextMenuExample = { demo: , }, { - title: `Using panels with mixed items & content`, + title: 'Using panels with mixed items & content', source: [ { type: GuideSectionTypes.JS, diff --git a/src-docs/src/views/drag_and_drop/drag_and_drop_example.js b/src-docs/src/views/drag_and_drop/drag_and_drop_example.js index 7fabe8aaee8..8a85acb90e8 100644 --- a/src-docs/src/views/drag_and_drop/drag_and_drop_example.js +++ b/src-docs/src/views/drag_and_drop/drag_and_drop_example.js @@ -60,16 +60,16 @@ export const DragAndDropExample = {

  • - {``}: Section of your + {''}: Section of your application containing the draggable elements and the drop targets.
  • - {``}: Area into which items can - be dropped. Contains {``}s. + {''}: Area into which items can + be dropped. Contains {''}s.
  • - {``}: Items that can be dragged. - Must be part of an {``} + {''}: Items that can be dragged. + Must be part of an {''}
@@ -158,7 +158,7 @@ export const DragAndDropExample = {