Skip to content

Commit

Permalink
Use new shared configs
Browse files Browse the repository at this point in the history
  • Loading branch information
GZolla authored and dlockhart committed Dec 3, 2024
1 parent b6880fb commit e3f951f
Show file tree
Hide file tree
Showing 3 changed files with 257 additions and 420 deletions.
54 changes: 14 additions & 40 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,17 @@
import { fileURLToPath } from 'node:url';
import { FlatCompat } from '@eslint/eslintrc';
import { browserConfig, nodeConfig, setDirectoryConfigs, testingConfig } from 'eslint-config-brightspace';
import globals from 'globals';
import { includeIgnoreFile } from '@eslint/compat';
import js from '@eslint/js';
import path from 'node:path';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});
const gitignorePath = path.resolve(__dirname, '.gitignore');

export default [
includeIgnoreFile(gitignorePath),
...compat.extends('brightspace/browser-config').map(config => ({
...config,
files: ['**/*.js'],
})),
...compat.extends('brightspace/node-config').map(config => ({
...config,
files: ['test/**/*'],
})),
export default setDirectoryConfigs(
browserConfig,
{
files: ['test/**/*'],

languageOptions: {
globals: {
...globals.mocha,
},

ecmaVersion: 'latest',
sourceType: 'module',
},
},
...compat.extends('brightspace/testing-config').map(config => ({
...config,
files: ['test/browser/**/*'],
})),
];
test: [
...nodeConfig,
{
languageOptions: {
globals: { ...globals.mocha }
}
}
],
'test/browser': testingConfig
}
);
Loading

0 comments on commit e3f951f

Please sign in to comment.