1
mirror of https://github.com/pure-css/pure synced 2024-11-18 02:36:30 +01:00

chore: upgrade to eslint@v9 (#1341)

This commit is contained in:
Seth Bertalotto 2024-10-07 10:40:18 -07:00 committed by GitHub
parent 1415a4b0d6
commit 18831f0ad6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 498 additions and 530 deletions

View File

@ -1,9 +0,0 @@
/build/
/node_modules/
/release/
# site files
/site/.docusaurus
/site/build
/site/node_modules
/site/static/css/pure

View File

@ -1,50 +0,0 @@
module.exports = {
'env': {
'browser': true,
'es6': true,
'node': true
},
'extends': [
'eslint:recommended',
'plugin:react/recommended'
],
'globals': {
'Atomics': 'readonly',
'SharedArrayBuffer': 'readonly'
},
'parserOptions': {
'ecmaFeatures': {
'jsx': true
},
'ecmaVersion': 11,
'sourceType': 'module'
},
'plugins': [
'react'
],
'rules': {
'indent': [
'error',
4
],
'linebreak-style': [
'error',
'unix'
],
'quotes': [
'error',
'single'
],
'react/no-unescaped-entities': 'off',
'react/prop-types': 'off',
'semi': [
'error',
'always'
]
},
'settings': {
'react': {
'version': 'detect'
}
}
};

View File

@ -13,7 +13,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 16.x
node-version: 20.x
- uses: webfactory/ssh-agent@v0.5.0
with:
ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }}

View File

@ -15,7 +15,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 16.x
node-version: 20.x
- run: npm ci
- run: npm run lint
- run: npm test

57
eslint.config.mjs Normal file
View File

@ -0,0 +1,57 @@
import js from '@eslint/js';
import globals from 'globals';
import reactPlugin from 'eslint-plugin-react';
export default [
js.configs.recommended,
reactPlugin.configs.flat.recommended,
{
ignores: [
'.idea/',
'*-debug.log',
'build/',
'node_modules/',
'release/',
'npm-*.log',
'site/.docusaurus',
'site/build',
'site/node_modules',
'site/static/css/pure',
],
},
{
files: ['**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}'],
languageOptions: {
...reactPlugin.configs.flat.recommended.languageOptions,
ecmaVersion: 2024,
globals: {
...globals.browser,
...globals.jest,
...globals.mocha,
...globals.node,
...globals.protractor,
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
sourceType: 'module',
},
},
plugins: {
react: reactPlugin,
},
rules: {
indent: [2, 4, { SwitchCase: 1 }],
quotes: [0, 'single'],
'no-console': 0,
'react/no-unescaped-entities': 0,
'react/prop-types': 0,
},
settings: {
react: {
version: 'detect',
},
},
},
];

View File

@ -8,7 +8,7 @@ module.exports = {
try {
cache[name] = fs.readFileSync(this.getFilePath(name), 'utf-8');
} catch(e) {
throw new Error(name + ' does not exist');
throw new Error(name + ' does not exist', e);
}
}
return cache[name];

897
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@
"url": "git://github.com/pure-css/pure.git"
},
"scripts": {
"lint": "eslint . --ext .js",
"lint": "eslint . --fix",
"prepare": "grunt release",
"start": "cd site && npm install && npm run start",
"test": "grunt test && tap test/*.js --no-coverage"
@ -17,8 +17,9 @@
"devDependencies": {
"@lodder/grunt-postcss": "^3.1.1",
"autoprefixer": "^10.4.2",
"eslint": "^8.0.0",
"eslint-plugin-react": "^7.31.10",
"eslint": "^9.12.0",
"eslint-plugin-react": "^7.37.1",
"globals": "^15.10.0",
"grunt": "^1.3.0",
"grunt-cli": "^1.2.0",
"grunt-contrib-clean": "^2.0.0",