CI: add eslint
Summary: Signed-off-by: Yongmin Hong <revi@omglol.email> npm: use @revi/eslint-config Also change eslint format, and publish `v0.0.2`. Also prepare for eslint-config-wikimedia when they have eslint9 support. Signed-off-by: Yongmin Hong <revi@omglol.email> Test Plan: `npm run eslint`. Reviewers: O1 revi & automations, revi Reviewed By: O1 revi & automations, revi Differential Revision: https://issuetracker.revi.xyz/D332
This commit is contained in:
parent
be3db3c067
commit
0f4b7c97e3
6 changed files with 3865 additions and 239 deletions
25
eslint.config.mjs
Normal file
25
eslint.config.mjs
Normal file
|
@ -0,0 +1,25 @@
|
|||
//@ts-check
|
||||
/**
|
||||
* @file revi/sandbox eslint config
|
||||
* @see https://eslint.org/docs/latest/use/configure/configuration-files
|
||||
* @type {import("eslint").Linter.Config}
|
||||
* @copyright Hong Yongmin 2024
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
import reviConfig from '@revi/eslint-config';
|
||||
// import wikimedia from 'eslint-config-wikimedia';
|
||||
|
||||
export default [
|
||||
...reviConfig,
|
||||
// blocked by eslint9 support:
|
||||
// https://github.com/wikimedia/eslint-config-wikimedia/issues/563
|
||||
//{
|
||||
// files: ['wikiassets/*.js'],
|
||||
// plugins: {wikimedia},
|
||||
// extends: ['wikimedia/client/es6', 'wikimedia/mediawiki'],
|
||||
// languageOptions: {
|
||||
// sourceType: 'script',
|
||||
// },
|
||||
//},
|
||||
];
|
|
@ -5,7 +5,11 @@ # @revi/eslint-config
|
|||
## Config
|
||||
|
||||
```js
|
||||
const config = [
|
||||
import globals from 'globals';
|
||||
import pluginJs from '@eslint/js';
|
||||
import eslintConfigPrettier from 'eslint-config-prettier';
|
||||
|
||||
export default [
|
||||
pluginJs.configs.recommended,
|
||||
{
|
||||
rules: {
|
||||
|
|
|
@ -12,7 +12,7 @@ import globals from 'globals';
|
|||
import pluginJs from '@eslint/js';
|
||||
import eslintConfigPrettier from 'eslint-config-prettier';
|
||||
|
||||
const config = [
|
||||
export default [
|
||||
pluginJs.configs.recommended,
|
||||
{
|
||||
rules: {
|
||||
|
@ -23,5 +23,3 @@ const config = [
|
|||
{languageOptions: {globals: globals.browser}},
|
||||
eslintConfigPrettier,
|
||||
];
|
||||
|
||||
export default config;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"$schema": "https://json.schemastore.org/package.json",
|
||||
"name": "@revi/eslint-config",
|
||||
"version": "0.0.1",
|
||||
"version": "0.0.2",
|
||||
"description": "@revi's shared eslint config",
|
||||
"main": "eslint.config.js",
|
||||
"peerDependencies": {
|
||||
|
@ -21,6 +21,11 @@
|
|||
"keywords": [
|
||||
"eslint"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/revi/sandbox.git",
|
||||
"directory": "npm/eslint-config"
|
||||
},
|
||||
"author": {
|
||||
"name": "Yongmin Hong",
|
||||
"url": "https://revi.xyz/",
|
||||
|
|
4058
package-lock.json
generated
4058
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -3,12 +3,16 @@
|
|||
"name": "@revi/scripts",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@revi/eslint-config": "^0.0.2",
|
||||
"@revi/prettier-config": "^0.0.2",
|
||||
"csslint": "^1.0.5",
|
||||
"eslint": "^9.5.0",
|
||||
"eslint-config-wikimedia": "^0.28.2",
|
||||
"jshint": "^2.13.6",
|
||||
"prettier": "^3.3.2"
|
||||
},
|
||||
"scripts": {
|
||||
"eslint": "eslint",
|
||||
"p:c": "prettier --check",
|
||||
"p:w": "prettier --write"
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue