Skip to content

Commit

Permalink
fix: lint problems
Browse files Browse the repository at this point in the history
  • Loading branch information
johnvente committed Mar 13, 2024
1 parent 50bdf03 commit b72e103
Show file tree
Hide file tree
Showing 6 changed files with 178 additions and 32 deletions.
2 changes: 0 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ dist
docs
node_modules
src/analytics/segment.js
src/react/PluggableComponent
src/react/utils/contextFactory
28 changes: 26 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
const path = require('path');
// eslint-disable-next-line import/no-extraneous-dependencies
const { getBaseConfig } = require('@openedx/frontend-build');

const config = getBaseConfig('eslint');

config.settings = {
'import/resolver': {
webpack: {
config: path.resolve(__dirname, 'webpack.dev.config.js'),
},
alias: {
map: [
['@communications-app', '.'],
],
extensions: ['.ts', '.js', '.jsx', '.json'],
},
},
};
config.rules = {
'import/no-extraneous-dependencies': ['error', {
devDependencies: [
Expand All @@ -12,11 +26,12 @@ config.rules = {
'example/*',
],
}],
'import/prefer-default-export': 'off',
'import/extensions': ['error', {
ignore: ['@edx/frontend-platform*'],
ignore: ['@edx/frontend-platform*', '@openedx/frontend-build*'],
}],
'import/no-unresolved': ['error', {
ignore: ['@edx/frontend-platform*'],
ignore: ['@edx/frontend-platform*', '@openedx/frontend-build*'],
}],
'jsx-a11y/anchor-is-valid': ['error', {
components: ['Link'],
Expand All @@ -25,4 +40,13 @@ config.rules = {
}],
};

config.overrides = [
{
files: ['plugins/**/*.jsx'],
rules: {
'import/no-extraneous-dependencies': 'off',
},
},
];

module.exports = config;
9 changes: 4 additions & 5 deletions example/ExamplePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { ensureConfig, mergeConfig, getConfig } from '@edx/frontend-platform';
import PluggableComponent from '@root_path/src/react/PluggableComponent';
import messages from './messages';


mergeConfig({
EXAMPLE_VAR: process.env.EXAMPLE_VAR,
});
Expand Down Expand Up @@ -51,11 +50,11 @@ class ExamplePage extends Component {
<p>JS_FILE_VAR var came through: <strong>{getConfig().JS_FILE_VAR}</strong></p>
<p>Visit <Link to="/authenticated">authenticated page</Link>.</p>
<p>Visit <Link to="/error_example">error page</Link>.</p>
<PluggableComponent
id="pluggable-component-test"
as="any-mfe-plugins-test"
<PluggableComponent
id="pluggable-component-test"
as="any-mfe-plugins-test"
title="This is my button plugin"
/>
/>
</div>
);
}
Expand Down
154 changes: 137 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b72e103

Please sign in to comment.