Skip to content

Commit

Permalink
Merge pull request #30 from SaekiTominaga/lint-config
Browse files Browse the repository at this point in the history
Update lint configuration file (ESLint flat config, etc...)
  • Loading branch information
SaekiTominaga authored Jul 26, 2024
2 parents 866e3e9 + 0af2a68 commit c2cc69e
Show file tree
Hide file tree
Showing 11 changed files with 482 additions and 603 deletions.
945 changes: 405 additions & 540 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
"github-actions-lint": "yamllint .github/workflows/*.yml"
},
"devDependencies": {
"@w0s/eslint-config": "^5.2.0",
"@w0s/stylelint-config": "^4.2.0",
"@w0s/eslint-config": "^6.0.2",
"@w0s/stylelint-config": "^4.7.0",
"@w0s/tsconfig": "^1.4.1",
"eslint": "^8.57.0",
"globals": "^15.8.0",
"prettier": "^3.2.5",
"stylelint": "^16.2.1",
"stylelint": "^16.7.0",
"typescript": "^5.3.3",
"yaml-lint": "^1.7.0"
},
Expand Down
22 changes: 0 additions & 22 deletions packages/bookmarklet/.eslintrc.json

This file was deleted.

25 changes: 25 additions & 0 deletions packages/bookmarklet/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// @ts-check

import globals from 'globals';
import tseslint from 'typescript-eslint';
import w0sConfig from '@w0s/eslint-config';

/** @type {import("@typescript-eslint/utils/ts-eslint").FlatConfig.ConfigArray} */
export default tseslint.config(
...w0sConfig,
{
ignores: ['dist/*.js'],
languageOptions: {
globals: globals.browser,
parserOptions: {
sourceType: 'script',
},
},
},
{
files: ['src/*.js'],
rules: {
'no-alert': 'off',
},
},
);
4 changes: 2 additions & 2 deletions packages/bookmarklet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "@browser/bookmarklet",
"private": true,
"type": "module",
"scripts": {
"build": "node build.js -i src -o dist",
Expand All @@ -9,5 +8,6 @@
"dependencies": {
"globby": "^13.2.0",
"terser": "^5.18.2"
}
},
"private": true
}
21 changes: 0 additions & 21 deletions packages/userscript/.eslintrc.json

This file was deleted.

24 changes: 24 additions & 0 deletions packages/userscript/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// @ts-check

import tseslint from 'typescript-eslint';
import w0sConfig from '@w0s/eslint-config';

/** @type {import("@typescript-eslint/utils/ts-eslint").FlatConfig.ConfigArray} */
export default tseslint.config(
...w0sConfig,
{
ignores: ['dist/*.js'],
languageOptions: {
parserOptions: {
sourceType: 'script',
},
},
},
{
files: ['src/*.user.ts'],
rules: {
'no-console': 'off',
strict: ['error', 'function'],
},
},
);
5 changes: 3 additions & 2 deletions packages/userscript/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "@browser/userscript",
"private": true,
"type": "module",
"scripts": {
"build": "tsc",
"watch": "tsc -w",
"lint": "eslint src/*.user.ts"
}
},
"private": true
}
11 changes: 0 additions & 11 deletions packages/userstyle/.stylelintrc.json

This file was deleted.

5 changes: 3 additions & 2 deletions packages/userstyle/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "@browser/userstyle",
"private": true,
"type": "module",
"scripts": {
"lint": "stylelint style/*.css"
}
},
"private": true
}
16 changes: 16 additions & 0 deletions packages/userstyle/stylelint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// @ts-check

/** @type {import('stylelint').Config} */
export default {
extends: ['@w0s/stylelint-config'],
rules: {
'at-rule-no-vendor-prefix': null,
'color-named': null,
'declaration-no-important': null,
'property-disallowed-list': null,
'selector-class-pattern': null,
'selector-id-pattern': null,
'selector-max-id': null,
'plugin/use-logical-properties-and-values': null,
},
};

0 comments on commit c2cc69e

Please sign in to comment.