Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore/update linting workflows and dependencies #1374

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .eslintignore

This file was deleted.

240 changes: 0 additions & 240 deletions .eslintrc.cjs

This file was deleted.

9 changes: 6 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,15 @@ Test cases that exercise custom loaders (like TypeScript, JSX plugins) for SSR a
1. Prefix the test case directory and spec file with _loaders-_
1. Make sure to pass `true` as the second param to `Runner`
```js
import { Runner } from 'gallinago';
let runner;

before(function() {
this.context = {
publicDir: path.join(outputPath, 'public')
};
// pass true as the second param here
runner = new Runner(false, true);
});

runner.runCommand(/* ... */);
```
1. Use the `yarn test:loaders` npm script

Expand Down
70 changes: 70 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import babelParser from '@babel/eslint-parser';
import markdown from '@eslint/markdown';
import json from '@eslint/json';
import js from '@eslint/js';
import globals from 'globals';
import noOnlyTests from 'eslint-plugin-no-only-tests';

export default [
{
// https://github.com/eslint/eslint/discussions/18304#discussioncomment-9069706
ignores: [
'.greenwood/*',
'node_modules/*',
'public/*',
'reports/*',
'coverage/*',
// 'packages/plugin-graphql/README.md',
'www/**'
],
},
{
languageOptions: {
parser: babelParser,
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
requireConfigFile: false,
babelOptions: {
plugins: ['@babel/plugin-syntax-import-assertions', '@babel/plugin-syntax-jsx'],
},
},
globals: {
...globals.browser,
...globals.mocha,
...globals.chai,
...globals.node,
},
},
rules: {
...js.configs.recommended.rules,
// turn this off for Prettier
'no-irregular-whitespace': 'off',
'no-only-tests/no-only-tests': 'error',
},
plugins: {
'no-only-tests': noOnlyTests,
},
},
{
// https://github.com/eslint/json#recommended-configuration
files: ['**/*.json'],
ignores: ['package-lock.json'],
language: 'json/json',
rules: json.configs.recommended.rules,
plugins: {
json,
},
},
{
// note: we can only lint code fences, _or_ the markdown files themselves
// so for now we will just lint the code fences
// https://github.com/eslint/markdown/blob/main/docs/processors/markdown.md#using-the-markdown-processor
files: ['**/*.md'],
processor: 'markdown/markdown',
plugins: {
markdown,
},
language: 'markdown/gfm',
},
];
26 changes: 11 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"scripts": {
"lerna": "lerna",
"clean": "rimraf ./**/.greenwood/** && rimraf ./**/public/** && rimraf ./coverage",
"clean": "rimraf --glob ./**/.greenwood/** ./**/public/** ./coverage",
"clean:deps": "rimraf **/node_modules/**",
"build": "cross-env __GWD_ROLLUP_MODE__=strict node . build",
"serve": "node . serve",
Expand All @@ -24,32 +24,28 @@
"test:loaders": "cross-env BROWSERSLIST_IGNORE_OLD_DATA=true __GWD_ROLLUP_MODE__=strict NODE_NO_WARNINGS=1 node --loader $(pwd)/test/test-loader.js ./node_modules/mocha/bin/mocha \"./packages/**/**/*.spec.js\"",
"test:loaders:win": "cross-env BROWSERSLIST_IGNORE_OLD_DATA=true __GWD_ROLLUP_MODE__=strict NODE_NO_WARNINGS=1 node --loader file:\\\\%cd%\\test\\test-loader.js ./node_modules/mocha/bin/mocha --exclude \"./packages/init/test/cases/**\" \"./packages/**/**/*.spec.js\"",
"test:tdd": "yarn test --watch",
"lint:js": "eslint \"*.js\" \"./packages/**/**/*.js\" \"./test/*.js\" \"./www/**/**/*.js\"",
"lint:ts": "eslint \"./packages/**/**/*.ts\"",
"lint:css": "stylelint \"./www/**/*.js\", \"./www/**/*.css\"",
"lint": "ls-lint && yarn lint:js && yarn lint:css"
"lint": "ls-lint && eslint"
},
"devDependencies": {
"@babel/core": "^7.24.4",
"@babel/eslint-parser": "^7.24.1",
"@babel/plugin-syntax-import-assertions": "^7.24.1",
"@babel/preset-react": "^7.24.1",
"@babel/eslint-parser": "^7.25.7",
"@babel/plugin-syntax-import-assertions": "^7.25.7",
"@babel/plugin-syntax-jsx": "^7.25.9",
"@eslint/js": "^9.11.1",
"@eslint/json": "^0.5.0",
"@eslint/markdown": "^6.2.0",
"@ls-lint/ls-lint": "^1.10.0",
"babel-eslint": "^10.1.0",
"c8": "^7.10.0",
"chai": "^4.2.0",
"cross-env": "^7.0.3",
"eslint": "^8.51.0",
"eslint-plugin-markdown": "^3.0.0",
"eslint": "^9.11.1",
"eslint-plugin-no-only-tests": "^2.6.0",
"gallinago": "^0.8.2",
"glob-promise": "^3.4.0",
"globals": "^15.10.0",
"jsdom": "^16.5.0",
"lerna": "^3.16.4",
"mocha": "^9.1.3",
"rimraf": "^2.6.3",
"stylelint": "^13.8.0",
"stylelint-a11y": "^1.2.3",
"stylelint-config-standard": "^20.0.0"
"rimraf": "^5.0.10"
}
}
Loading