Ghost/ghost/admin/.eslintrc.js
Kevin Ansfield d991da399c Added support for building/rendering react components
no issue

- updated ember-cli-build and eslint config to support jsx
- added `react` and `react-dom` libraries
  - included them in the build so the `React` and `ReactDom` globals are available for use by third party components
  - added vendor shims so we can do things like `import * from 'react'` where the imports are referenced directly to the already imported modules
- added `<ReactComponent>` component
  - designed to be extended from in specific react component classes
  - renders a div and calls `renderComponent()` action once inserted - this should be replaced in any extended classes in order to render a react component
  - handles react rendering and teardown
- added `<ReactMobiledocEditor>` react component that renders an editor composed of components provided by the `react-mobiledoc-editor` package
- added `<KoenigReactEditor>` ember component that renders `<ReactMobiledocEditor>` and handles pass-through of Ember arguments and handling of actions
- updated `<GhKoenigEditorReact>` to render `<KoenigReactEditor>` in place of `<KoenigEditor>`
2022-07-19 12:48:53 +01:00

55 lines
1.6 KiB
JavaScript

/* eslint-env node */
module.exports = {
root: true,
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
allowImportExportEverywhere: false,
ecmaFeatures: {
globalReturn: false,
legacyDecorators: true,
jsx: true
},
requireConfigFile: false,
babelOptions: {
plugins: [
'@babel/plugin-proposal-class-properties',
['@babel/plugin-proposal-decorators', {legacy: true}],
'babel-plugin-transform-react-jsx'
]
}
},
plugins: [
'ghost',
'react'
],
extends: [
'plugin:ghost/ember'
],
rules: {
'no-shadow': ['error'],
// TODO: migrate away from accessing controller in routes
'ghost/ember/no-controller-access-in-routes': 'off',
// TODO: enable once we're fully on octane 🏎
'ghost/ember/no-assignment-of-untracked-properties-used-in-tracking-contexts': 'off',
'ghost/ember/no-actions-hash': 'off',
'ghost/ember/no-classic-classes': 'off',
'ghost/ember/no-classic-components': 'off',
'ghost/ember/require-tagless-components': 'off',
'ghost/ember/no-component-lifecycle-hooks': 'off',
// disable linting of `this.get` until there's a reliable autofix
'ghost/ember/use-ember-get-and-set': 'off',
// disable linting of mixins until we migrate away
'ghost/ember/no-mixins': 'off',
'ghost/ember/no-new-mixins': 'off',
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error'
}
};